[Haskell-cafe] Re: Why is there no splitBy in the list module?

Jared Updike jupdike at gmail.com
Wed Jul 12 19:17:21 EDT 2006


> > fields = csv `separateWith` ","
> > csv = fields `joinWith` "," -- equivalent to concatIntersperse
>
> Hence I would much rather have the split condition be the first
> parameter -- the infix notation looks good, but it will need a
> "flip" to get the parameters in the right order.

This also goes along with join in python, i.e.

"\n".join(xs)
  ==>
"\n" `join` xs
   in Haskell (where    join sep = concat . intersperse sep )

  Jared.


More information about the Haskell-Cafe mailing list