
24 Mar
2009
24 Mar
'09
10:15 p.m.
Dan Piponi ha scritto:
Miguel Mitrofanov wrote:
takeList = evalState . mapM (State . splitAt)
However, ironically, I stopped using them for pretty much the same reason that Manlio is saying.
Are you saying there's a problem with this implementation? It's the only one I could just read immediately.
Yes, you understand it immediately once you know what a state monad is. But how well is introduced, explained and emphasized the state monad in current textbooks? When I started learning Haskell, the first thing I learned was recursion and pattern matching. So, this may be the reason why I find more readable my takeList solution.
[...]
Manlio