Help with coercion & roles?

Conal Elliott conal at conal.net
Mon Apr 14 04:59:37 UTC 2014


I’m working on a GHC plugin (as part of my Haskell-to-hardware work) and
running into trouble with coercions & roles. Error message from Core Lint:

Warning: In the expression:

  LambdaCCC.Lambda.lamvP#
    @ (GHC.Types.Bool → GHC.Types.Bool → GHC.Types.Bool → GHC.Types.Bool)
    @ (Simple.HasIf GHC.Types.Bool)
    "tpl"#
    ((LambdaCCC.Lambda.varP#
        @ (GHC.Types.Bool → GHC.Types.Bool → GHC.Types.Bool → GHC.Types.Bool)
        "tpl"#)
     `cast` (<LambdaCCC.Lambda.EP>_N (Sym (Simple.NTCo:HasIf[0]
<GHC.Types.Bool>_N))
             ∷ LambdaCCC.Lambda.EP
                  (GHC.Types.Bool
                   → GHC.Types.Bool → GHC.Types.Bool → GHC.Types.Bool)
                  ~#
                LambdaCCC.Lambda.EP (Simple.HasIf GHC.Types.Bool)))
 Role incompatibility: expected nominal, got representationalin
<LambdaCCC.Lambda.EP>_N (Sym (Simple.NTCo:HasIf[0]
<GHC.Types.Bool>_N))

Do you see anything inconsistent/incompatible in the coercions or roles
above? I constructed the nominal EP Refl coercion, and applied it (AppCo)
an existing coercion of a simpler type.

Thanks,
-- Conal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140413/84d837f5/attachment.html>


More information about the ghc-devs mailing list