[commit: packages/ghc-prim] master: Define GHC.Types.Coercible (32ab616)

git at git.haskell.org git at git.haskell.org
Fri Sep 13 23:49:39 CEST 2013


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

On branch  : master
Link       : http://git.haskell.org/?p=packages/ghc-prim.git;a=commit;h=32ab616f4da1bd9029cc0dbe307b5c6f7ead3951

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

commit 32ab616f4da1bd9029cc0dbe307b5c6f7ead3951
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Fri Sep 13 18:45:35 2013 +0200

    Define GHC.Types.Coercible
    
    This data type is required so that Coercible (which is actually a class
    and is exported from GHC.Prim) has a info table etc., similar to ~


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

32ab616f4da1bd9029cc0dbe307b5c6f7ead3951
 GHC/Types.hs |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/GHC/Types.hs b/GHC/Types.hs
index e7983e7..1a582bf 100644
--- a/GHC/Types.hs
+++ b/GHC/Types.hs
@@ -85,3 +85,8 @@ newtype IO a = IO (State# RealWorld -> (# State# RealWorld, a #))
 -- has kind (? -> ? -> Fact) rather than (* -> * -> *)
 data (~) a b = Eq# ((~#) a b)
 
+-- | A data constructor used to box up unlifted representational equalities.
+--
+-- The type constructor is special as GHC pretends the field of EqR# has type
+-- (a ~R# b), which is not representable in Haskell, and turns it into a class.
+data Coercible a b = MkCoercible ((~#) a b)




More information about the ghc-commits mailing list