[GHC] #8026: DatatypeContexts should be fixed, not deprecated

GHC ghc-devs at haskell.org
Tue Jul 2 23:47:26 CEST 2013


#8026: DatatypeContexts should be fixed, not deprecated
-------------------------------+--------------------------------------------
  Reporter:  gidyn             |          Owner:                  
      Type:  feature request   |         Status:  new             
  Priority:  normal            |      Milestone:                  
 Component:  Compiler          |        Version:  7.6.3           
Resolution:                    |       Keywords:                  
        Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown      |     Difficulty:  Unknown         
  Testcase:                    |      Blockedby:                  
  Blocking:                    |        Related:                  
-------------------------------+--------------------------------------------

Comment(by monoidal):

 @gidyn: What would the type of `x` be in your example?

 You probably want `x` to ''introduce'' the validity of constraint `Eq a`.
 So the type would be somewhat dual to  `Eq a => Pair a -> a`: using it
 would prove the constraint `Eq a`, rather than requiring evidence for the
 constraint. Something like `Pair a -> (Eq a; a)`.

 It seems to me this change would complicate the type system a lot, while
 the benefits are rather doubtful.

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



More information about the ghc-tickets mailing list