david48 <[EMAIL PROTECTED]> wrote:
> On 8/3/07, Neil Mitchell <[EMAIL PROTECTED]> wrote:
> >
> > 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.
>
Yes, unless of course you did:
instance (Monad m, Num n) => Num (m n)
or some such nonsense. :)
> If you meant :
>
> x <- return 12
> let x = ( <- x )
This would be equally wrong. Perhaps you meant:
do let x = return 12
let x = (<- x)
...
Then this would become:
do let x = return 12
t1 <- x
let x = t1
...
Which is, in turn:
let x = return 12 in x >>= (\t1 -> let x = t1 in ...)
--
Chris Smith
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe