on 37a5192 help sign in
8 files changed+8−58
since splitsnapshots
unifiedsplit
.gitignore−1 CHANGELOG.md−15 example/Main.hs−1 src/TypeFun/Data/List.hs+1−1 src/TypeFun/Data/Peano.hs+3−14 stack.yaml−9 stack.yaml.lock−12 type-fun.cabal+4−5
.gitignore−1
@@ -2,4 +2,3 @@ dist
22TAGS
33.cabal-sandbox
44cabal.sandbox.config
5−.stack-work
CHANGELOG.md−15
@@ -4,20 +4,5 @@
44
55# CHANGELOG
66
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−
227## 0.0.1
238First version
example/Main.hs−1
@@ -37,5 +37,4 @@ main = do
3737 print $ prefixConstr p2
3838 print $ prefixConstr p3
3939 print $ uniqConstr p2
40− print $ peanoVal (Proxy :: Proxy (FromNat 100))
4140 -- print $ uniqConstr p3 -- < ElementIsNotUniqInList Int '[Int, Bool, Int]
src/TypeFun/Data/List.hs+1−1
@@ -40,7 +40,7 @@ module TypeFun.Data.List
4040 , ElementIsUniq
4141 , UniqElements
4242 , UniqElements'
43− -- * Unsafe helpers
43+ -- * Helpers
4444 , appendId
4545 , subListId
4646 ) where
src/TypeFun/Data/Peano.hs+3−14
@@ -1,6 +1,5 @@
11module TypeFun.Data.Peano
22 ( N(..)
3− , KnownPeano(..)
43 , ToNat
54 , FromNat
65 , (:+:)
@@ -8,24 +7,14 @@ module TypeFun.Data.Peano
87 , (:*:)
98 ) where
109
11−import Data.Typeable
12−import GHC.Generics (Generic)
13−import GHC.TypeLits
10+import Data.Typeable
11+import GHC.Generics (Generic)
12+import GHC.TypeLits
1413
1514data N = Z | S N
1615 deriving ( Eq, Ord, Read, Show
1716 , Generic, Typeable )
1817
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−
2918type family ToNat (a :: N) :: Nat where
3019 ToNat Z = 0
3120 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 @@
11name: type-fun
2−version: 0.1.2
2+version: 0.0.1
33synopsis: Collection of widely reimplemented type families
44license: BSD3
55license-file: LICENSE
@@ -19,7 +19,6 @@ library
1919 hs-source-dirs: src
2020 default-extensions: ConstraintKinds
2121 , DataKinds
22− , DeriveDataTypeable
2322 , DeriveGeneric
2423 , FlexibleInstances
2524 , MultiParamTypeClasses
@@ -36,15 +35,15 @@ library
3635 , TypeFun.Data.Maybe
3736 , TypeFun.Data.Peano
3837
39− build-depends: base >= 4.7 && < 5
38+ build-depends: base >=4.7 && <4.9
39+
4040
4141test-suite example
4242 type: exitcode-stdio-1.0
4343 default-language: Haskell2010
4444 hs-source-dirs: example
4545 main-is: Main.hs
46− default-extensions: ConstraintKinds
47− , DataKinds
46+ default-extensions: DataKinds
4847 , GADTs
4948 , TemplateHaskell
5049 , TypeFamilies