
3 Aug
2007
3 Aug
'07
3:55 p.m.
david48
On 8/3/07, Neil Mitchell
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