Disappearing case alternative?

Conal Elliott conal at conal.net
Fri Mar 11 21:49:48 UTC 2016

I'm working on a GHC plugin, mainly in the form of a "builtin" rewrite
rule, and I'm seeing a strange disappearance of a case alternative. With
-ddump-rule-rewrites, I can see before & after the disappearance: Here's
one rule firing with the alternative present:

    Rule fired
        Rule: reify
        Before: reifyP
                  TyArg Pair Int -> Int
                  ValArg \ (ds :: Pair Int) ->
                           case ds of _ { :# a b -> $fNumInt_$c+ a b }
        After:  lamP
                  @ (Pair Int)
                  @ Int
                  (\ (ds :: EP (Pair Int)) ->
                       @ Int
                       (case evalP @ (Pair Int) ds of _ { :# a b ->
$fNumInt_$c+ a b }))
        Cont:   StrictArg toE
                Stop[BoringCtxt] E Prim (Pair Int -> Int)

The next thing I see is the rule firing again on the residual reifyP
application, but with the case alternative gone:

    Rule fired
        Rule: reify
        Before: reifyP
                  TyArg Int ValArg case evalP @ (Pair Int) ds of wild { }
        After:  ...

Any ideas what's causing the disappearance?

Thanks.  - Conal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160311/1521b1c9/attachment-0001.html>

More information about the ghc-devs mailing list