Browse files

Add Reify type class for conversion to values

  • Loading branch information...
1 parent e559d3d commit 76c308093dcbc3b0e433801ac3387b995628aa43 @Shimuuar committed Jul 31, 2010
Showing with 23 additions and 0 deletions.
  1. +22 −0 TypeLevel/Reify.hs
  2. +1 −0 type-numbers.cabal
View
22 TypeLevel/Reify.hs
@@ -0,0 +1,22 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+-- |
+-- Module : TypeLevel.Reify
+-- Copyright : Alexey Khudyakov
+-- License : BSD3-style (see LICENSE)
+--
+-- Maintainer : Alexey Khudyakov <alexey.skladnoy@gmail.com>
+-- Stability : unstable
+-- Portability : unportable (GHC only)
+module TypeLevel.Reify ( Witness(..)
+ , Reify(..)
+ ) where
+
+
+data Witness t a = Witness { getValue :: a }
+
+-- | Convert type level into value level using
+class Reify t a where
+ witness :: Witness t a
+
+
+
View
1 type-numbers.cabal
@@ -42,6 +42,7 @@ Library
TypeLevel.Number.Nat.Num
TypeLevel.Number.Int
TypeLevel.Boolean
+ TypeLevel.Reify
Other-modules: TypeLevel.Number.Nat.Types
TypeLevel.Number.Int.Types
TypeLevel.Util

0 comments on commit 76c3080

Please sign in to comment.