summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Dammers <tdammers@gmail.com>2018-03-27 12:19:49 +0200
committerTobias Dammers <tdammers@gmail.com>2018-03-27 12:19:49 +0200
commite70ae1fe4b2b4dfeccf359a9e36eafa801a4ac54 (patch)
treebb5c2b5f48de1e6413adc94248ca6a0fde3ef1e6
parent325fa912c6f8fbc767dd45a9a333ee50563761cf (diff)
downloadhaskell-wip/T14975.tar.gz
Define MCoercion typewip/T14975
-rw-r--r--compiler/types/Coercion.hs2
-rw-r--r--compiler/types/TyCoRep.hs5
2 files changed, 6 insertions, 1 deletions
diff --git a/compiler/types/Coercion.hs b/compiler/types/Coercion.hs
index 7a7918c250..f55cab128a 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 588963d012..9323e23de6 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]
~~~~~~~~~~~~~~~~~~~~~