[GHC] #13957: Allow deriving multiparameter type classes with representationally equal arguments

GHC ghc-devs at haskell.org
Tue Jul 18 18:45:56 UTC 2017


#13957: Allow deriving multiparameter type classes with representationally equal
arguments
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 We cannot both have `SIEVE I (->)` and `SIEVE Identity (->)` if we assume
 a functional dependency, similar to #13404 where an analogous example
 would compile

 {{{#!hs
 class SIEVE p where
   type SIEVE_ty p :: Type -> Type
   sIEVE :: p a b -> (a -> SIEVE_ty p b)

 instance SIEVE (->) where
   type SIEVE_ty (->) = Identity
   sIEVE :: (a -> b) -> (a -> Identity b)
   sIEVE f = f >>> Identity

 newtype ARR a b = ARR (a -> b)
   deriving newtype
     SIEVE
 }}}

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


More information about the ghc-tickets mailing list