[Haskell-cafe] Should "do 1" compile

Neil Mitchell ndmitchell at gmail.com
Wed May 23 13:27:32 EDT 2007


Hi,

As discussed on #haskell, the following code:

----------------
module Foo where
foo = do (1 :: Int)
----------------

Compiles fine on Yhc, but doesn't on Hugs and GHC.

GHC:
    Couldn't match expected type `t t1' against inferred type `Int'
    In the expression: (1 :: Int)
    In the expression: do (1 :: Int)
    In the definition of `foo': foo = do (1 :: Int)

Hugs:
ERROR "test.hs":4 - Type error in final generator
*** Term           : 1
*** Type           : Int
*** Does not match : a b

So the question is, who is right? Where do the bugs need filing? Does
this issue need clarifying for Haskell' ?

Thanks

Neil


More information about the Haskell-Cafe mailing list