#714: inconsistency between handling of class and signature constraints
----------------------------------------+-----------------------------------
    Reporter:  [EMAIL PROTECTED]  |        Owner:         
        Type:  feature request          |       Status:  new    
    Priority:  normal                   |    Milestone:         
   Component:  Compiler (Type checker)  |      Version:  6.5    
    Severity:  normal                   |     Keywords:         
          Os:  Unknown                  |   Difficulty:  Unknown
Architecture:  Unknown                  |  
----------------------------------------+-----------------------------------
the user's guide claims

 7.4.2 3. There are no restrictions on the context in a class declaration
 (which introduces superclasses), except that the class hierarchy must be
 acyclic.

 and we also have

 7.4.3.1 1. Each universally quantified type variable tvi must be reachable
 from type
 suggesting that FDs are taken into account when considering reachability

 but that only seems to work for signature, not for class constraints,
 as the attached example shows. I wouldn't go so far as claiming this
 as a bug, but it prevents an otherwise straightforward encoding of
 ATS in FDs (where the superclass encodes the type function, see last
 month's discussion on haskell-cafe).

 [grr, there isn't a button for attachment on this form, so I'll paste the
 code]
 {{{
 {-# OPTIONS_GHC -fglasgow-exts #-}
 class C a b | a -> b
 class C a b => D a
 f :: C a b => a
 f = undefined
 }}}

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