I converted the code in the paper "Monadic Parsing in Haskell" to
Clojure. Both m-plus and m-seq are used to combine lists of parsers.
m-plus is used to build a parser that executes each parser in the list
until one succeeds. m-seq is used to build a parser that executes all
the parsers in the list sequentially and only succeeds if all the
Having m-plus accept a variable number of args is great, in that
case. Having m-seq only accept one arg, which is a list, didn't feel
like it followed the pattern established by m-plus.
In any case, it's a pretty minor thing to adapt m-seq, so if there are
other cases where the current implementation is easier, it's no big
deal. Just felt like little rough edge.
Do you have a concrete use case where this would be advantageous? In
my certainly limited experience, m-plus is most frequently called
with two fixed arguments, whereas m-seq is typically called with a
list argument that was constructed using other list operations. In
the latter situation, the change you propose is a significant
disadvantage, all the more since m-seq is a macro and thus cannot be
used directly with apply.