[nhc-bugs] Type synonyms

Ralf Hinze ralf@cs.uu.nl
Wed, 26 Sep 2001 17:18:10 +0200


nhc doesn't like the following program ...

> type Option = Maybe

> f :: Option a -> Maybe a
> f =  id

> main = putStrLn "hello world"

Transscript of the session ...

>>> nhc98 --version
/home/ralf/Lang/bin/nhc98: v1.08 (2001-09-25)
  [ config: ix86-Linux/ghc by malcolm@pc173.cs.york.ac.uk on 25 Sep 2001 ]
>>> nhc98 -v Bug.lhs
nhc98comp +RTS -RTS -unlit -P/home/ralf/Lang/include/nhc98 ./Bug.lhs ./Bug.lhs /tmp/Bug.12000.hi /tmp/Bug.12000.hc

====================================
        Error after type deriving/checking:
Type error can not unify Prelude.Maybe with 1 and 0 arguments
when binding final type to function at 4:8.

The problem disappears if we change the type definition to

> type Option a = Maybe a

Cheers, Ralf