[ ghc-Bugs-1293181 ] reporting the origin of kind errors

SourceForge.net noreply at sourceforge.net
Mon Sep 19 05:32:31 EDT 2005


Bugs item #1293181, was opened at 2005-09-16 19:13
Message generated for change (Settings changed) made by simonpj
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1293181&group_id=8032

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compiler (Type checker)
Group: 6.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Chris Rodrigues (nokta_kanto)
Assigned to: Nobody/Anonymous (nobody)
Summary: reporting the origin of kind errors

Initial Comment:
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' 
 

----------------------------------------------------------------------

>Comment By: Simon Peyton Jones (simonpj)
Date: 2005-09-19 09:32

Message:
Logged In: YES 
user_id=50165

Happily this one is fixed already: (Will be in 6.4.1)

Foo1.hs:7:5:
    Kind error: `Name a' is not applied to enough type 
arguments
    In the data type declaration for `Exp'

Thanks for reporting it

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1293181&group_id=8032



More information about the Glasgow-haskell-bugs mailing list