
23 May
2007
23 May
'07
6:54 p.m.
Hi
foo = do (1 :: Int)
While intuitively this should be disallowed, it seems a pity that desugaring couldn't be totally separated from typechecking. Hmm.
You can always desugar as: do x ==> return () >> x Although then you are relying on the Monad laws more than you possibly should. You could also have: monady :: Monad m => m a -> m a monady x = x do x ==> monady x Then you are relying on an additional function that doesn't currently exist. Thanks Neil