Hi there,


When I compile the module below with ghc-4.01
and -fglasgow-exts, I get the following error message:

YouCantDoThat.lhs:8:
    Kind mis-match between `_a :: *' and `Int# :: *#'
        Expected type: _a -> Int'
        Inferred type: Int# -> Int'
    In the first argument of `$', namely `Int''
    In the right-hand side of an equation for `disallowed':
        Int' $ (a +# a)

The function @allowed@ seems perfectly ok.

> module YouCantDoThat( disallowed, allowed ) where

> import GlaExts

> data Int' = Int' Int#

> disallowed :: Int# -> Int'
> disallowed a = Int' $ a +# a

> allowed :: Int# -> Int'
> allowed a = Int' (a +# a)

One additional comment. I frequently use quotes (') as suffixes
for identifier and type names. As can be seen above ghc loves adding
quotes (` and ') around parts of its messages. This becomes *very*
confusing when the last part of the message consists of an
identifier suffixed by a one or more quote symbols.



Regards,

Marc van Dongen

Reply via email to