summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2022-02-17 21:19:36 +0000
committerBen Gamari <ben@well-typed.com>2022-02-21 17:09:25 +0000
commit9882db62761ba4664bd918fd362a32f00e73fd72 (patch)
tree4f85d713d9d67b75c751af6a2c231f5005dd55c3
parent177d6a7849632fe07d2ed785aadc7d23f7d28ae9 (diff)
downloadhaskell-9882db62761ba4664bd918fd362a32f00e73fd72.tar.gz
Flip some bits (directions of coercions in rewriting)
-rw-r--r--compiler/GHC/Tc/Solver/Rewrite.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC/Tc/Solver/Rewrite.hs b/compiler/GHC/Tc/Solver/Rewrite.hs
index 5f8d0886ae..c83d5d3ad2 100644
--- a/compiler/GHC/Tc/Solver/Rewrite.hs
+++ b/compiler/GHC/Tc/Solver/Rewrite.hs
@@ -551,20 +551,20 @@ rewrite_one (FunTy { ft_af = vis, ft_mult = mult, ft_arg = ty1, ft_res = ty2 })
(rewrite_one res_rep)
; role <- getRole
- ; let arg_rep_co = snd arg_rep_redn
+ ; let arg_rep_co = mkSymCo (snd arg_rep_redn)
-- :: arg_rep ~ arg_rep_xi
arg_ki_co = mkTyConAppCo Nominal tYPETyCon [arg_rep_co]
-- :: TYPE arg_rep ~ TYPE arg_rep_xi
casted_arg_redn =
( mkCastTy arg_xi arg_ki_co
- , mkCoherenceRightCo role arg_xi arg_ki_co arg_co
+ , mkCoherenceLeftCo role arg_xi arg_ki_co arg_co
)
-- :: ty1 ~> arg_xi |> arg_ki_co
- res_ki_co = mkTyConAppCo Nominal tYPETyCon [snd res_rep_redn]
+ res_ki_co = mkTyConAppCo Nominal tYPETyCon [mkSymCo $ snd res_rep_redn]
casted_res_redn =
( mkCastTy res_xi res_ki_co
- , mkCoherenceRightCo role res_xi res_ki_co res_co
+ , mkCoherenceLeftCo role res_xi res_ki_co res_co
)
-- We must rewrite the representations, because that's what would