[GHC] #14131: Difference between newtype and newtype instance

GHC ghc-devs at haskell.org
Mon Aug 21 15:17:24 UTC 2017


#14131: Difference between newtype and newtype instance
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  RyanGlScott
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #7938, #9574,     |  Differential Rev(s):  Phab:D3872
  #13985                             |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > Ah, I think I managed to confuse you

 I am indeed terribly confused.  I can now just about see what you are
 doing.

 * The `hsib_vars` wrapped around the `HsTyPats` includes (via the renamer)
 the variables mentioned in the RHS.   You arrange that `tc_fam_ty_pats`
 returns them to its caller.

 * Now in `tcFamTyPats` you can take that set of variables, and subtract
 from it those bound on the LHS (gotten from the free vars of the
 typechecked pates).  Result is the ones on the RHS but not LHS.

 Ugh!

 I bet that all this will look different, and much more perspicous, once
 we've done the refactoring in comment:9.  As you suggest, let's do that
 first.  Yell if you need any help

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


More information about the ghc-tickets mailing list