[Haskell-cafe] about Haskell code written to be "too smart"
Clive Brettingham-Moore
haskell at brettingham-moore.net
Tue Mar 24 19:48:24 EDT 2009
Code like that is why I love Haskell, while I haven't written a Haskell
program in years it is still a joy to read (much more so than the pretty
good zipWith version).
In reference to later comments: if you don't know Monads, you don't know
Haskell; that goes double for high order functions.
So really the only place where this code may be inappropriate is in a
beginner tutorial (unless you are trying to show why they need to learn
more!).
C
Miguel Mitrofanov wrote:
> takeList ns xs = evalState (mapM (State . splitAt) ns) xs
>
> or even
>
> takeList = evalState . map (State . splitAt)
>
More information about the Haskell-Cafe
mailing list