Skip to content

Types don't match expressions in type error

Frederik Eaton points out in the thread starting http://www.haskell.org/pipermail/glasgow-haskell-bugs/2007-March/008748.html that with this program:

a x = x True ++ [1]

-- ok
b = a (const [2])

-- uninformative error message
c = a y

-- more informative
d = a ()

y = const ()

in the type error, for b the type doesn't match the expression: y has type a -> () but it claims to have infered () for it:

v.hs:8:6:
    Couldn't match expected type `[a]' against inferred type `()'
    In the first argument of `a', namely `y'
    In the expression: a y
    In the definition of `c': c = a y

(this example should be made into a testcase once we know what the error will look like).

Trac metadata
Trac field Value
Version 6.6
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information