
14 Oct
2009
14 Oct
'09
2:35 p.m.
Dear café,
{-# LANGUAGE Rank2Types #-} {-# LANGUAGE ImpredicativeTypes #-}
type Void = forall a. a
newtype Mono a = Mono { runMono :: [Void] }
beep :: Mono a -> Mono a beep (Mono vs) = Mono (map undefined vs)
Compiling this with GHC results in:
Monotype.hs:9:28: Cannot match a monotype with `Void' Expected type: Void Inferred type: a
What does this error mean and why does the code not compile? Thanks! Martijn.