on 1cecd27 help sign in
CHANGELOG.md−7
since splitsnapshots
unifiedsplit
@@ -4,13 +4,6 @@
4
4
5# CHANGELOG
5# CHANGELOG
6
6
7−## 0.1.2
8−### Added KnownPeano
9−
10−## 0.1.1
11−### Fixed
12−* Compilable with ghc-8.0.1
13−
14## 0.1.0
7## 0.1.0
15### Added
8### Added
16* Type family `Substract` to remove elements of one list from another
9* Type family `Substract` to remove elements of one list from another
example/Main.hs−1
@@ -37,5 +37,4 @@ 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))
41 -- print $ uniqConstr p3 -- < ElementIsNotUniqInList Int '[Int, Bool, Int]
40 -- print $ uniqConstr p3 -- < ElementIsNotUniqInList Int '[Int, Bool, Int]
src/TypeFun/Data/Peano.hs+3−14
@@ -1,6 +1,5 @@
1module TypeFun.Data.Peano
1module TypeFun.Data.Peano
2 ( N(..)
2 ( N(..)
3− , KnownPeano(..)
4 , ToNat
3 , ToNat
5 , FromNat
4 , FromNat
6 , (:+:)
5 , (:+:)
@@ -8,24 +7,14 @@ module TypeFun.Data.Peano
8 , (:*:)
7 , (:*:)
9 ) where
8 ) where
10
9
11−import Data.Typeable
10+import Data.Typeable
12−import GHC.Generics (Generic)
11+import GHC.Generics (Generic)
13−import GHC.TypeLits
12+import GHC.TypeLits
14
13
15data N = Z | S N
14data N = Z | S N
16 deriving ( Eq, Ord, Read, Show
15 deriving ( Eq, Ord, Read, Show
17 , Generic, Typeable )
16 , Generic, Typeable )
18
17
19−-- | @since 0.1.2
20−class KnownPeano (p :: N) where
21− peanoVal :: proxy p -> Integer
22−
23−instance KnownPeano Z where
24− peanoVal _ = 0
25−
26−instance (KnownPeano n) => KnownPeano (S n) where
27− peanoVal _ = succ $ peanoVal (Proxy :: Proxy n)
28−
29type family ToNat (a :: N) :: Nat where
18type family ToNat (a :: N) :: Nat where
30 ToNat Z = 0
19 ToNat Z = 0
31 ToNat (S a) = 1 + (ToNat a)
20 ToNat (S a) = 1 + (ToNat a)
stack.yamldeleted−9
@@ -1,9 +0,0 @@
1−nix:
2− packages:
3− - zlib
4− - postgresql
5−
6−resolver: lts-13.21
7−
8−packages:
9− - .
stack.yaml.lockdeleted−12
@@ -1,12 +0,0 @@
1−# This file was autogenerated by Stack.
2−# You should not edit this file by hand.
3−# For more information, please see the documentation at:
4−# https://docs.haskellstack.org/en/stable/lock_files
5−
6−packages: []
7−snapshots:
8−- completed:
9− size: 498180
10− url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/13/21.yaml
11− sha256: eff2de19a6d4691ccbf6edc1fba858f1918683047dce0f09adede874bbd2a8f3
12− original: lts-13.21
type-fun.cabal+2−2
@@ -1,5 +1,5 @@
1name: type-fun
1name: type-fun
2−version: 0.1.2
2+version: 0.1.0
3synopsis: Collection of widely reimplemented type families
3synopsis: Collection of widely reimplemented type families
4license: BSD3
4license: BSD3
5license-file: LICENSE
5license-file: LICENSE
@@ -36,7 +36,7 @@ library
36 , TypeFun.Data.Maybe
36 , TypeFun.Data.Maybe
37 , TypeFun.Data.Peano
37 , TypeFun.Data.Peano
38
38
39− build-depends: base >= 4.7 && < 5
39+ build-depends: base >=4.7 && <4.9
40
40
41test-suite example
41test-suite example
42 type: exitcode-stdio-1.0
42 type: exitcode-stdio-1.0