on 37a5192 help sign in
.gitignore−1
since splitsnapshots
unifiedsplit
@@ -2,4 +2,3 @@ dist
2TAGS
2TAGS
3.cabal-sandbox
3.cabal-sandbox
4cabal.sandbox.config
4cabal.sandbox.config
5−.stack-work
CHANGELOG.md−15
@@ -4,20 +4,5 @@
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
15−### Added
16−* Type family `Substract` to remove elements of one list from another
17−* Unsafe helper functions to relax constraints in some safe points. But we use
18− `unsafeCoerce` so this functions are potentially just break constants
19−### Changed
20−* Compilable under ghc-7.8
21−
22## 0.0.1
7## 0.0.1
23First version
8First version
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/List.hs+1−1
@@ -40,7 +40,7 @@ module TypeFun.Data.List
40 , ElementIsUniq
40 , ElementIsUniq
41 , UniqElements
41 , UniqElements
42 , UniqElements'
42 , UniqElements'
43− -- * Unsafe helpers
43+ -- * Helpers
44 , appendId
44 , appendId
45 , subListId
45 , subListId
46 ) where
46 ) where
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+4−5
@@ -1,5 +1,5 @@
1name: type-fun
1name: type-fun
2−version: 0.1.2
2+version: 0.0.1
3synopsis: Collection of widely reimplemented type families
3synopsis: Collection of widely reimplemented type families
4license: BSD3
4license: BSD3
5license-file: LICENSE
5license-file: LICENSE
@@ -19,7 +19,6 @@ library
19 hs-source-dirs: src
19 hs-source-dirs: src
20 default-extensions: ConstraintKinds
20 default-extensions: ConstraintKinds
21 , DataKinds
21 , DataKinds
22− , DeriveDataTypeable
23 , DeriveGeneric
22 , DeriveGeneric
24 , FlexibleInstances
23 , FlexibleInstances
25 , MultiParamTypeClasses
24 , MultiParamTypeClasses
@@ -36,15 +35,15 @@ library
36 , TypeFun.Data.Maybe
35 , TypeFun.Data.Maybe
37 , TypeFun.Data.Peano
36 , TypeFun.Data.Peano
38
37
39− build-depends: base >= 4.7 && < 5
38+ build-depends: base >=4.7 && <4.9
39+
40
40
41test-suite example
41test-suite example
42 type: exitcode-stdio-1.0
42 type: exitcode-stdio-1.0
43 default-language: Haskell2010
43 default-language: Haskell2010
44 hs-source-dirs: example
44 hs-source-dirs: example
45 main-is: Main.hs
45 main-is: Main.hs
46− default-extensions: ConstraintKinds
46+ default-extensions: DataKinds
47− , DataKinds
48 , GADTs
47 , GADTs
49 , TemplateHaskell
48 , TemplateHaskell
50 , TypeFamilies
49 , TypeFamilies