[GHC] #9063: Default associated type instances are too general

GHC ghc-devs at haskell.org
Tue May 6 00:04:20 UTC 2014


#9063: Default associated type instances are too general
-------------------------------------+------------------------------------
        Reporter:  goldfire          |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.8.2
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by goldfire):

 It might help to note ''why'' I'm pushing this. I'm working on expanding
 the promotion algorithm in the `singletons` package to include classes and
 instances. I want to promote method definitions to associated type family
 instances. Currently, something like this is peachy:

 {{{
 instance Eq () where
   _ == _ = True
 }}}

 However, with the current treatment of associated type instances as
 discussed here, the promoted version of this (in my "instance example"
 above) does not work without explicit kind annotations. My implementation
 currently has to store method types, do a lookup on method definitions,
 and then do a type substitution to produce the needed kind annotations.
 This isn't terribly hard, really, but it just seems unnecessary.

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


More information about the ghc-tickets mailing list