#6159: unexpected GADT kind error
----------------------------------------+-----------------------------------
  Reporter:  kosmikus                   |          Owner:                  
      Type:  bug                        |         Status:  closed          
  Priority:  normal                     |      Milestone:                  
 Component:  Compiler                   |        Version:  7.5             
Resolution:  invalid                    |       Keywords:                  
        Os:  Unknown/Multiple           |   Architecture:  Unknown/Multiple
   Failure:  GHC rejects valid program  |     Difficulty:  Unknown         
  Testcase:                             |      Blockedby:                  
  Blocking:                             |        Related:                  
----------------------------------------+-----------------------------------

Comment(by simonpj):

 Ah yes, that's a good point.  The difficult is this.  For polymorphic
 recursion we need to know when you have supplied a complete kind signature
 for a type contructor. When (and only when) you supply a complete kind
 signature, you can use polymorphic recursion.

 At the value level this is obvious enough: you have supplied a type
 signature for `f` if you write `f :: blah`.  But at the kind level it's
 not so obvious.  In your definition for `Y` you have supplied part, but
 not all, of a kind signature.

 Currently I've said that you have supplied "a complete kind signature"
 when you give a "::" in the definition.  That is,
  * with "::" the kind is ''declared'';
  * without "::" it is ''inferred''.
 That certainly is a change but it seems one that is easy to explain.  I'd
 welcome suggestions for what changes I should make elsewhere in the user
 manual; where did you look when you were seeking information?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6159#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to