[GHC] #15952: Reduce zonking-related invariants in the type checker

GHC ghc-devs at haskell.org
Thu Dec 6 09:04:22 UTC 2018


#15952: Reduce zonking-related invariants in the type checker
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  8.6.3
       Component:  Compiler          |              Version:  8.6.2
      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 simonpj):

 I propose dividing Step 2 into two.

 * '''Step 2a''': make `tcTypeKind` monadic, and get rid of the `naked`
 functions.  This will fix #15799 and #15918.

 * '''Step 2b''': make `substTy` monadic too.

 After Step 2a, we still have

 * Invariant `(ForallInv)`: in a 'forall' type `forall a. blah`, all
 occurrences of `a` should still be visible in `blah` without zonking.

 So we don't need to make `substTy` monadic in Step 2a. Personally I think
 that Step 2b might not be worth the bother.  Maintaining `(ForallInv)` is
 really not hard, whereas maintaining `Note [The well-kinded type
 invariant]` is extremely tricky.

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


More information about the ghc-tickets mailing list