Permalink
Browse files

Use reify to convert type level booleans to value level ones

  • Loading branch information...
1 parent 76c3080 commit 6ba562f55618959175ce22946092060afe9ab7f4 @Shimuuar committed Jul 31, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 TypeLevel/Boolean.hs
View
@@ -1,5 +1,6 @@
-{-# LANGUAGE TypeFamilies #-}
-{-# LANGUAGE EmptyDataDecls #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE EmptyDataDecls #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
module TypeLevel.Boolean ( True
, False
-- * Boolean operations
@@ -13,6 +14,7 @@ module TypeLevel.Boolean ( True
, xorT
) where
+import TypeLevel.Reify
-- | Data type for truth
data True
@@ -22,6 +24,9 @@ data False
instance Show False where show _ = "False"
instance Show True where show _ = "True"
+instance Reify True Bool where witness = Witness True
+instance Reify False Bool where witness = Witness False
+
----------------------------------------------------------------
-- | Negation

0 comments on commit 6ba562f

Please sign in to comment.