[Haskell-cafe] Question about kinds

Klaus Ostermann ko at daimi.au.dk
Fri Jun 6 18:41:07 EDT 2008

Why does the code below not pass the type checker?

If I could explictly parameterize y with the type constructor Id (as e.g. in
System F), then 'y Id' should have the type Int -> Int
and hence "y Id x" should be OK, but with Haskell's implicit type parameters
it does not work.

So, how can I make this work?


type Id a = a

x :: Id Int
x = undefined

y :: (a Int) -> (a Int)
y = undefined

test = y x

  Couldn't match expected type `a Int' against inferred type `Id Int'
  In the first argument of `y', namely `x'
  In the expression: y x
  In the definition of `test': test = y x

View this message in context: http://www.nabble.com/Question-about-kinds-tp17701553p17701553.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

More information about the Haskell-Cafe mailing list