[GHC] #13408: Consider inferring a higher-rank kind for type synonyms

GHC ghc-devs at haskell.org
Sat Nov 3 23:19:20 UTC 2018


#13408: Consider inferring a higher-rank kind for type synonyms
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  TypeInType
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 goldfire):

 A few remarks about the code:

 - Put the `solveEqualities` around the first line, as the `tcLHsType` can
 emit constraints, and these will need to be solved.
 - Remove the second line. We don't need to run `kcTyClDecl` here.
 `kcTyClDecl`'s purpose in life is to generate constraints on the
 unification variables generates in `getInitialKind`. But we're not calling
 `getInitialKind`, so no need for `kcTyClDecl`.
 - Generalization looks about right.

 About the changed error messages:
 - The first will be hard to fix, for the reasons you describe. You could
 probably put some variant of `APromotionErr` in the env't to get a better
 message here. No, you can't just put the tycon in the env't, because
 you're making the tycon. Don't even think about `fixM` here.
 - The others just want for a `addTyConCtxt` around the call to
 `generalise`, which does a wee bit of validity checking.

 Otherwise, looks good!

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


More information about the ghc-tickets mailing list