On Wed, 23 May 2007 19:54:27 +0100
"Neil Mitchell" <[EMAIL PROTECTED]> wrote:
> 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

How about:

 do x ==> (x :: Monad m => m a)

Or even:

 do x ==> (asTypeOf x (return ()))


Cheers,
Spencer Janssen
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to