[Haskell-cafe] Re: Re: monad subexpressions
david48
dav.vire+haskell at gmail.com
Fri Aug 3 15:48:05 EDT 2007
Sorry for the double post, I posted with the wrong email address and
haskell-cafe rejected it.
On 8/3/07, Neil Mitchell <ndmitchell at gmail.com> wrote:
> > Right. In effect, as a matter of fact, the notation
> >
> > x <- a
> >
> > would become equivalent to
> >
> > let x = (<- a)
>
> Hmm, interesting. Consider:
>
> let x = 12
> let x = (<- x)
Wouldn't that be forbidden ?
I'd expect the x in ( <- x ) have to be of type m a.
If you meant :
x <- return 12
let x = ( <- x )
Then I imagine it would turn into
x <- return 12
x >>= \tx -> let x = tx in ....
Isn't that correct ?
More information about the Haskell-Cafe
mailing list