on master help sign in
test
commit642b423ea566590d4c4ab717a8403713e9988305 authorAleksey Uymanov <s9gf4ult@gmail.com> dateSun 11 Oct 2020, 21:58 (6 years ago) parent3d4e50b
2 files changed+5−3
example/Main.hs+1 src/TypeFun/Data/Peano.hs+4−3
example/Main.hs+1
@@ -37,4 +37,5 @@ main = do
3737 print $ prefixConstr p2
3838 print $ prefixConstr p3
3939 print $ uniqConstr p2
40+ print $ peanoVal (Proxy :: Proxy (FromNat 100))
4041 -- print $ uniqConstr p3 -- < ElementIsNotUniqInList Int '[Int, Bool, Int]
src/TypeFun/Data/Peano.hs+4−3
@@ -1,5 +1,6 @@
11module TypeFun.Data.Peano
22 ( N(..)
3+ , KnownPeano(..)
34 , ToNat
45 , FromNat
56 , (:+:)
@@ -7,9 +8,9 @@ module TypeFun.Data.Peano
78 , (:*:)
89 ) where
910
10−import Data.Typeable
11−import GHC.Generics (Generic)
12−import GHC.TypeLits
11+import Data.Typeable
12+import GHC.Generics (Generic)
13+import GHC.TypeLits
1314
1415data N = Z | S N
1516 deriving ( Eq, Ord, Read, Show