[GHC] #11735: Optimize coercionKind

GHC ghc-devs at haskell.org
Wed Jan 24 14:19:16 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:                    |
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * cc: goldfire (added)


Comment:

 Great.  Next step:

 1.  We should not spend 20% our time in `CoreTidy`, I think.  Drill down.

 2.  Something is clearly wrong with `Simplify.simplCast`.  I think I know
 what it is.  Given
 {{{
 (fun |> co) @t1 @t2 ... @tn
 }}}
   we will call `pushCoTyArg` `n` times, and hence does `n` singleton
 substitutions, via the `n` calls to `piResultTy`.

   Solution: gather up those type arguments (easy) and define
 {{{
 pushCoTyArgs :: Coercion -> [Type] -> Maybe ([Type], Coercion)
 }}}
   using an accumulating substitution.  I spent a few minutes trying to
 write down `pushCoTyArgs` but my brain melted in a mess of kind casts, and
 I ran out of time.

 '''Richard''' can you help with (2), please?

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


More information about the ghc-tickets mailing list