Prelude function suggestions

Marcin 'Qrczak' Kowalczyk qrczak at
Thu Jul 29 07:57:51 EDT 2004

W liście z czw, 29-07-2004, godz. 13:39 +0200, Tomasz Zielonka napisał:

> Have you looked at List.unfoldr? It's even more general.
>     unfoldr :: (b -> Maybe (a, b)) -> b -> [a]

And when we finally find a very general solution, the specific case of
"split colon-separated fields" requires some thought and three lines of
code using higher order functions and pattern matching, instead of just
   splitSep (== ':') line

Make simple things easy, complex things possible. Concentrate on the
first part. Generalize only if it doesn't make the common simple case
harder. After all, one always can write a complex splitting function
by hand. The simple version doesn't have to cover all possible
generalizations, only those which don't disturb common cases.

   __("<         Marcin Kowalczyk
   \__/       qrczak at

More information about the Libraries mailing list