#3850: EmptyDataDecls and type context
---------------------------------+------------------------------------------
    Reporter:  Paczesiowa        |        Owner:                           
        Type:  bug               |       Status:  new                      
    Priority:  normal            |    Milestone:                           
   Component:  Compiler          |      Version:  6.12.1                   
    Keywords:  emptydatadecls    |   Difficulty:                           
          Os:  Unknown/Multiple  |     Testcase:                           
Architecture:  Unknown/Multiple  |      Failure:  GHC rejects valid program
---------------------------------+------------------------------------------

Comment(by guest):

 I believe contexts on data declarations might not be totally useless, even
 if there are no constructors. The HList code in question had the
 following declaration

 data HNat x => Label x ns desc  -- labels are exclusively type-level
 entities

 The context HNat is asserted not because we want to use any of HNat's
 methods. Rather, the constraint HNat was asserted as a kind predicate --
 to
 show to the user that the type variable x is of a kind natural
 numbers, so to speak. Therefore, the type (Label HZero Foo Foo) is the
 correct instance of label.  On the other hand, the type (Label Bool
 Foo Foo) is not a correct instance and will be flagged as such by the
 compiler.

 Oleg

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3850#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