[GHC] #11534: Allow class associated types to reference functional dependencies

GHC ghc-devs at haskell.org
Thu Feb 4 11:58:04 UTC 2016


#11534: Allow class associated types to reference functional dependencies
-------------------------------------+-------------------------------------
        Reporter:  ekmett            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.10.3
  checker)                           |             Keywords:  TypeFamilies,
      Resolution:                    |  FunctionalDependencies
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > I can't define
 {{{
 type Fun c d f = Functor (Dom f) (Cod f) f
 }}}
 No indeed. So don't.  Just have a single-parameter `Functor` class!
 {{{
 class Functor (f :: i -> j) where
   type Dom f :: i -> i -> *
   type Cod f :: j -> j -> *
 }}}
 Now, I understand you are saying "a single-parameter `Functor` class is
 exactly what I would like but there is a problem".  So rather than fix
 difficulties with the workaround, let's fix the actual problem.  What
 exactly is it?  What type family do you need to partially apply?  So far
 we have `Dom` and `Cod`.  Do you need to partially apply those?  Can you
 just walk me through slowly the exact problem with the direct approach?

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


More information about the ghc-tickets mailing list