[GHC] #9582: Associated Type Synonyms do not unfold in InstanceSigs

GHC ghc-devs at haskell.org
Wed Sep 17 22:12:23 UTC 2014


#9582: Associated Type Synonyms do not unfold in InstanceSigs
-------------------------------------+-------------------------------------
              Reporter:              |            Owner:
  andreas.abel                       |           Status:  new
                  Type:  bug         |        Milestone:
              Priority:  normal      |          Version:  7.8.3
             Component:  Compiler    |         Keywords:  InstanceSigs
  (Type checker)                     |  TypeFamilies
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 It's not just type families.  You'd also expect that re-ordering the
 constraints in a qualified context would make no difference:
 {{{
 expected:   (Eq a, Num a) => a -> a
 actual:     (Num a, Eq a) => a -> a
 }}}
 I think the Right Thing is to use `TcUnify.tcSubType`, twice.  It checks
 that t1 is more polymorphic than t2; so you can call it with t1,t2 and
 with t2,t1.  It instantiates one type, skolemises the other, and does full
 constraint solving.   Look at other calls to `tcSubType` to see how it is
 used.

 Simon

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


More information about the ghc-tickets mailing list