[Haskell-cafe] about Haskell code written to be "too smart"
miguelimo38 at yandex.ru
Tue Mar 24 15:29:55 EDT 2009
> | As an example, with the takeList function I posted.
> I looked at it, found nothing wrong with the original, and absolutely
> hated your "fixed" version. I might have written it like this,
> ~ buildPartitions xs ns = zipWith take ns . init . scanl (flip
> xs $ ns
Maybe it's just me, but I think that
takeList ns xs = evalState (mapM (State . splitAt) ns) xs
takeList = evalState . map (State . splitAt)
would be much clearer than both versions.
More information about the Haskell-Cafe