Skip to content

reporting the origin of kind errors

This code produces a kind error in the class declaration.  
There is indeed a kind error, but I think the error message 
is somewhat misleading.  It reports a kind error in the class 
declaration.  The kind error is due to an inconsistency 
between usage of "Name" in the class and data 
declarations. 
 
It would make more sense to me if the kind error were 
reported in the data declaration, or if it contained some 
information on how the expected kind was inferred. 
 
-- beginning of code 
class (Show a, Eq a, Monad m) => Name m a where 
    hashName :: a -> Int 
    newName :: m a 
 
data Name a => Exp a 
-- end of code 
 
The error reported is: 
test2.hs:1:0: 
    Couldn't match kind `*' against `k_a16S -> *' 
    In the class declaration for `Name' 
 
Trac metadata
Trac field Value
Version 6.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedFixed
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information