[commit: ghc] wip/T14975: Define MCoercion type (e70ae1f)

git at git.haskell.org git at git.haskell.org
Tue May 1 07:39:21 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T14975
Link       : http://ghc.haskell.org/trac/ghc/changeset/e70ae1fe4b2b4dfeccf359a9e36eafa801a4ac54/ghc

>---------------------------------------------------------------

commit e70ae1fe4b2b4dfeccf359a9e36eafa801a4ac54
Author: Tobias Dammers <tdammers at gmail.com>
Date:   Tue Mar 27 12:19:49 2018 +0200

    Define MCoercion type


>---------------------------------------------------------------

e70ae1fe4b2b4dfeccf359a9e36eafa801a4ac54
 compiler/types/Coercion.hs | 2 +-
 compiler/types/TyCoRep.hs  | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/compiler/types/Coercion.hs b/compiler/types/Coercion.hs
index 7a7918c..f55cab1 100644
--- a/compiler/types/Coercion.hs
+++ b/compiler/types/Coercion.hs
@@ -10,7 +10,7 @@
 --
 module Coercion (
         -- * Main data type
-        Coercion, CoercionN, CoercionR, CoercionP,
+        Coercion, CoercionN, CoercionR, CoercionP, MCoercion,
         UnivCoProvenance, CoercionHole, LeftOrRight(..),
         Var, CoVar, TyCoVar,
         Role(..), ltRole,
diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs
index 588963d..9323e23 100644
--- a/compiler/types/TyCoRep.hs
+++ b/compiler/types/TyCoRep.hs
@@ -34,6 +34,7 @@ module TyCoRep (
         UnivCoProvenance(..),
         CoercionHole(..), coHoleCoVar,
         CoercionN, CoercionR, CoercionP, KindCoercion,
+        MCoercion,
 
         -- * Functions over types
         mkTyConTy, mkTyVarTy, mkTyVarTys,
@@ -857,6 +858,10 @@ type CoercionR = Coercion       -- always representational
 type CoercionP = Coercion       -- always phantom
 type KindCoercion = CoercionN   -- always nominal
 
+-- | A semantically more meaningful type to represent what may or may not be a
+-- useful 'Coercion'.
+data MCoercion = MRefl | MCo Coercion
+
 {-
 Note [Refl invariant]
 ~~~~~~~~~~~~~~~~~~~~~



More information about the ghc-commits mailing list