summaryrefslogtreecommitdiff
path: root/compiler/deSugar
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-09-17 11:34:28 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-09-17 13:46:28 +0100
commitaf7cc9953217d74e88d4d21512e957edd8e97ec9 (patch)
tree35e6c6b82a87c65a6a28508a357c282deb4f8087 /compiler/deSugar
parent510f4394b6574c930b71bd430ca2cb8d25022fac (diff)
downloadhaskell-af7cc9953217d74e88d4d21512e957edd8e97ec9.tar.gz
Implement 'left' and 'right' coercions
This patch finally adds 'left' and 'right' coercions back into GHC. Trac #7205 gives the details. The main change is to add a new constructor to Coercion: data Coercion = ... | NthCo Int Coercion -- OLD, still there | LRCo LeftOrRight Coercion -- NEW data LeftOrRight = CLeft | CRight Plus: * Similar change to TcCoercion * Use LRCo when decomposing AppTys * Coercion optimisation needs to handle left/right The rest is just knock-on effects.
Diffstat (limited to 'compiler/deSugar')
-rw-r--r--compiler/deSugar/DsBinds.lhs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/deSugar/DsBinds.lhs b/compiler/deSugar/DsBinds.lhs
index 803cdd886e..b418c8d592 100644
--- a/compiler/deSugar/DsBinds.lhs
+++ b/compiler/deSugar/DsBinds.lhs
@@ -834,6 +834,7 @@ ds_tc_coercion subst tc_co
go (TcSymCo co) = mkSymCo (go co)
go (TcTransCo co1 co2) = mkTransCo (go co1) (go co2)
go (TcNthCo n co) = mkNthCo n (go co)
+ go (TcLRCo lr co) = mkLRCo lr (go co)
go (TcInstCo co ty) = mkInstCo (go co) ty
go (TcLetCo bs co) = ds_tc_coercion (ds_co_binds bs) co
go (TcCastCo co1 co2) = mkCoCast (go co1) (go co2)