[GHC] #11735: Optimize coercionKind

GHC ghc-devs at haskell.org
Wed Jan 24 13:46:05 UTC 2018


#11735: Optimize coercionKind
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.3
      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 tdammers):

 Replying to [comment:6 simonpj]:
 > >  We should do the same thing to coercionKindRole. (Tiresomely.)
 >
 > Actually, looking at it, I think it'd be better to define
 > {{{
 > coercionRole :: Coercion -> Role
 > }}}
 > directly (a simple, fast recursive function), and then define
 > {{{
 > coercionKindRole :: Coercion -> (Pair Type, Role)
 > coercionKindRole co = (coercionKind co, coercionRole co)
 > }}}
 > Less duplication, and (I strongly suspect) faster. Could you try that
 and check perf?

 I'm not sure I understand what `coercionRole` would look like. Also, does
 that mean that the inline notes in the existing `coercionRoleKinds` and
 `coercionRole` functions don't apply anymore?

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


More information about the ghc-tickets mailing list