[Haskell-cafe] generalized list comprehensions
Johannes Waldmann
waldmann at imn.htwk-leipzig.de
Sat Nov 8 19:25:32 EST 2008
> I don't think we
> considered the possibility you might use do notation for the list
> monad, as it's not an idiom that seems to occur often.
depends where you look, I guess. (Such questions could in principle
be answered automatically by browsing the code on hackage?)
As I said, I am avoiding list comprehensions for purely optical reasons
(putting the cart before the horse), so I write "do" in the list monad.
Of course I prefer "let" to "where" for the same reasons,
so for me you could indeed replace "guard" by "where",
and "return" by "select", and "x <- foo" by "from x in foo"
and it'd look like the real (linq) thing. - Oh, and replace
"Monad" by "Workflow". - Not!
NB: Wasn't there a time (before "do") when "list" notation (brackets)
would work in any monad? And "map" was a method in "Functor",
and we had "class Functor m => Monad m", etc. Well well well times have
changed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20081109/973a5e07/signature.bin
More information about the Haskell-Cafe
mailing list