n-tuple 0.0.2.0 → 0.0.3
raw patch · 3 files changed
+16/−14 lines, 3 filesdep +singletons-basedep −singletonsdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: singletons-base
Dependencies removed: singletons
Dependency ranges changed: base
API changes (from Hackage documentation)
- Data.NTuple: instance (Data.Data.Data a, GHC.TypeNats.KnownNat size) => Data.Data.Data (Data.NTuple.NTuple size a)
+ Data.NTuple: instance (GHC.TypeNats.KnownNat size, Data.Data.Data a) => Data.Data.Data (Data.NTuple.NTuple size a)
- Data.NTuple: incl :: (n <= (size + 1), (n :> 0) ~ 'True, KnownNat n, size' ~ If (n :== (size + 1)) (size + 1) size) => Proxy n -> a -> NTuple size a -> NTuple size' a
+ Data.NTuple: incl :: (n <= (size + 1), (n > 0) ~ 'True, KnownNat n, size' ~ If (n == (size + 1)) (size + 1) size) => Proxy n -> a -> NTuple size a -> NTuple size' a
- Data.NTuple: proj :: (n <= size, (n :> 0) ~ 'True, KnownNat n) => Proxy n -> NTuple size a -> a
+ Data.NTuple: proj :: (n <= size, (n > 0) ~ 'True, KnownNat n) => Proxy n -> NTuple size a -> a
Files
- README.md +2/−0
- n-tuple.cabal +8/−8
- src/Data/NTuple.hs +6/−6
README.md view
@@ -1,5 +1,7 @@ # n-tuple +This is a silly implementation of "homogeneous n-length tuples" -- basically+an array. Internally, it builds a `Vector`, and projections just pull that index. ```haskell {-# LANGUAGE DataKinds -#}
n-tuple.cabal view
@@ -1,13 +1,15 @@--- This file has been generated from package.yaml by hpack version 0.21.2.+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack ----- hash: 17c9efc57c5bc53e00f65b0975640b32118c7241bde8b404e1aaef40ab7ae29e+-- hash: 4ef6565b8f250ce02a19d82b03f0f8cca0733fe789ef59557c4f669ef7405f90 name: n-tuple-version: 0.0.2.0+version: 0.0.3 synopsis: Homogeneous tuples of arbitrary length.-description: Please see the README on Github at <https://github.com/athanclark/sparrow-server#readme>+description: Please see the README on Github at <https://github.com/athanclark/n-tuple#readme> homepage: https://github.com/athanclark/n-tuple#readme bug-reports: https://github.com/athanclark/n-tuple/issues author: Athan Clark@@ -16,8 +18,6 @@ license: BSD3 license-file: LICENSE build-type: Simple-cabal-version: >= 1.10- extra-source-files: README.md @@ -34,7 +34,7 @@ src ghc-options: -Wall build-depends:- base ==4.10.*- , singletons >=2.3 && <2.4+ base >=4.11 && <5+ , singletons-base >=3 , vector default-language: Haskell2010
src/Data/NTuple.hs view
@@ -36,9 +36,9 @@ import GHC.TypeLits import Data.Proxy (Proxy (..)) import Data.List (intercalate)-import Data.Singletons.Prelude (If)-import Data.Singletons.Prelude.Eq (PEq ((:==)))-import Data.Singletons.Prelude.Ord (POrd ((:>)))+import Prelude.Singletons (If)+import Data.Eq.Singletons (PEq ((==)))+import Data.Ord.Singletons (POrd ((>))) import Data.Data (Data, Typeable) import GHC.Generics (Generic)@@ -59,7 +59,7 @@ -- | Project an element out of the tuple proj :: ( n <= size- , (n :> 0) ~ 'True+ , (n > 0) ~ 'True , KnownNat n ) => Proxy n -- ^ The index@@ -70,9 +70,9 @@ -- | Include an element to the tuple, overwriting on an existing index incl :: ( n <= (size + 1)- , (n :> 0) ~ 'True+ , (n > 0) ~ 'True , KnownNat n- , size' ~ If (n :== (size + 1)) (size + 1) size+ , size' ~ If (n == (size + 1)) (size + 1) size ) => Proxy n -- ^ The index -> a