on master help sign in
test
642b423Aleksey Uymanov
example/Main.hs+1
@@ -37,4 +37,5 @@ main = do
37 print $ prefixConstr p2
37 print $ prefixConstr p2
38 print $ prefixConstr p3
38 print $ prefixConstr p3
39 print $ uniqConstr p2
39 print $ uniqConstr p2
40+ print $ peanoVal (Proxy :: Proxy (FromNat 100))
40 -- print $ uniqConstr p3 -- < ElementIsNotUniqInList Int '[Int, Bool, Int]
41 -- print $ uniqConstr p3 -- < ElementIsNotUniqInList Int '[Int, Bool, Int]
src/TypeFun/Data/Peano.hs+4−3
@@ -1,5 +1,6 @@
1module TypeFun.Data.Peano
1module TypeFun.Data.Peano
2 ( N(..)
2 ( N(..)
3+ , KnownPeano(..)
3 , ToNat
4 , ToNat
4 , FromNat
5 , FromNat
5 , (:+:)
6 , (:+:)
@@ -7,9 +8,9 @@ module TypeFun.Data.Peano
7 , (:*:)
8 , (:*:)
8 ) where
9 ) where
9
10
10−import Data.Typeable
11+import Data.Typeable
11−import GHC.Generics (Generic)
12+import GHC.Generics (Generic)
12−import GHC.TypeLits
13+import GHC.TypeLits
13
14
14data N = Z | S N
15data N = Z | S N
15 deriving ( Eq, Ord, Read, Show
16 deriving ( Eq, Ord, Read, Show