[Haskell-cafe] do notation strangeness
Stefan O'Rear
stefanor at cox.net
Sat Dec 8 12:03:36 EST 2007
On Sat, Dec 08, 2007 at 02:59:16PM -0200, Felipe Lessa wrote:
> Hello!
>
> I see from http://www.haskell.org/haskellwiki/Monads_as_computation#Do_notation
> that
>
> do { v <- x ; <stmts> }
> = x >>= \v -> do { <stmts> }
>
> Something seems wrong to me here. What am I missing?
That rule only applies when v is an irrefutable pattern. The Haskell
Report lists the full rule.
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20071208/28819a76/attachment.bin
More information about the Haskell-Cafe
mailing list