[GHC] #14223: Casts get in the way of join points

GHC ghc-devs at haskell.org
Thu Sep 14 12:52:50 UTC 2017


#14223: Casts get in the way of join points
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  JoinPoints
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):

 Trouble is, the transformation that pushes continuations into join RHSs
 would become ill-typed.  Consider
 {{{
 case (join j x = e in
       case b of
         True -> j x |> g
         False -> r)
  of ALTS
 }}}
 Here we are allowing `j` as  a join point, as proposed in comment:7.  Now
 move that outer case inwards:
 {{{
 join j x = case e of ALTS in
 case b of
   True -> j x
   False -> case r of ALTS
 }}}
 Alas, the two `(case . of ALTS)` are now scrutinising values of different
 types!

 You could say "just live with that" but I don't know what the consequences
 would be.  Better, I think, to move the casts around somehow.

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


More information about the ghc-tickets mailing list