[Haskell-beginners] Loop

Marcin Mrotek marcin.jan.mrotek at gmail.com
Fri May 1 14:23:51 UTC 2015


It depends on what are you trying to achieve. The ListT monad
transformer is an overkill for your example, as you don't use the
"non-determinism" feature of ListT (code written using it can use
whole lists of values as if it was one value with multiple "versions",
any action can return any number of results, which are then combined
together, perhaps without even calculating all of them if they're not
needed); if you just want to sequence actions, it's enough to use
mapM, mapM_, sequence, sequence_, and other functions from
Control.Monad. But if you have something more complicated in mind, it
might be worth taking a look at ListT and other transformers to see if
they can be of any use to you.

Best regards,
Marcin Mrotek


More information about the Beginners mailing list