[Haskell-cafe] Should "do 1" compile

Benja Fallenstein benja.fallenstein at gmail.com
Wed May 23 14:55:29 EDT 2007


2007/5/23, Ian Lynagh <igloo at earth.li>:
> On Wed, May 23, 2007 at 06:27:32PM +0100, Neil Mitchell wrote:
> >
> > 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 *could* desugar it to

foo = (id :: Monad m => m a -> m a) (1 :: Int)

- Benja


More information about the Haskell-Cafe mailing list