[Haskell-cafe] extending Do notation
silvio
silvio.frischi at gmail.com
Tue May 20 20:42:00 UTC 2014
> f x
> | a && (b > 1 || (c && d)) && e = ...
>
> Now if 'c' becomes monadic you have to rewrite the whole expression in
> an entirely different (and much noisier) style. Not just all the
> lifting, but you can't use infix operators anymore. It really does
> feel like there are two languages (or dialects), with different idioms
> and syntax. You can translate between them without much complicated
> effort, but it's still a manual translation.
>
Good example, but i don't think you can have monads in a guard. Also I'd
go for the temporary variable instead of lifting.
More information about the Haskell-Cafe
mailing list