vec 0 → 0.1
raw patch · 4 files changed
+43/−29 lines, 4 filesdep −boringdep ~adjunctionsdep ~basedep ~base-compatPVP ok
version bump matches the API change (PVP)
Dependencies removed: boring
Dependency ranges changed: adjunctions, base, base-compat, criterion, distributive, fin, hashable, inspection-testing, lens, semigroupoids, semigroups
API changes (from Hackage documentation)
- Data.Vec.Lazy: instance n ~ 'Data.Nat.Z => Data.Boring.Boring (Data.Vec.Lazy.Vec n a)
- Data.Vec.Pull: instance n ~ 'Data.Nat.Z => Data.Boring.Boring (Data.Vec.Pull.Vec n a)
- Data.Vec.Lazy: [:::] :: a -> Vec n a -> Vec (S n) a
+ Data.Vec.Lazy: [:::] :: a -> Vec n a -> Vec ( 'S n) a
- Data.Vec.Lazy: [VNil] :: Vec Z a
+ Data.Vec.Lazy: [VNil] :: Vec 'Z a
- Data.Vec.Lazy: _Cons :: Iso (Vec (S n) a) (Vec (S n) b) (a, Vec n a) (b, Vec n b)
+ Data.Vec.Lazy: _Cons :: Iso (Vec ( 'S n) a) (Vec ( 'S n) b) (a, Vec n a) (b, Vec n b)
- Data.Vec.Lazy: _head :: Lens' (Vec (S n) a) a
+ Data.Vec.Lazy: _head :: Lens' (Vec ( 'S n) a) a
- Data.Vec.Lazy: _tail :: Lens' (Vec (S n) a) (Vec n a)
+ Data.Vec.Lazy: _tail :: Lens' (Vec ( 'S n) a) (Vec n a)
- Data.Vec.Lazy: cons :: a -> Vec n a -> Vec (S n) a
+ Data.Vec.Lazy: cons :: a -> Vec n a -> Vec ( 'S n) a
- Data.Vec.Lazy: empty :: Vec Z a
+ Data.Vec.Lazy: empty :: Vec 'Z a
- Data.Vec.Lazy: foldMap1 :: Semigroup s => (a -> s) -> Vec (S n) a -> s
+ Data.Vec.Lazy: foldMap1 :: Semigroup s => (a -> s) -> Vec ( 'S n) a -> s
- Data.Vec.Lazy: head :: Vec (S n) a -> a
+ Data.Vec.Lazy: head :: Vec ( 'S n) a -> a
- Data.Vec.Lazy: ifoldMap1 :: Semigroup s => (Fin (S n) -> a -> s) -> Vec (S n) a -> s
+ Data.Vec.Lazy: ifoldMap1 :: Semigroup s => (Fin ( 'S n) -> a -> s) -> Vec ( 'S n) a -> s
- Data.Vec.Lazy: singleton :: a -> Vec (S Z) a
+ Data.Vec.Lazy: singleton :: a -> Vec ( 'S 'Z) a
- Data.Vec.Lazy: tail :: Vec (S n) a -> Vec n a
+ Data.Vec.Lazy: tail :: Vec ( 'S n) a -> Vec n a
- Data.Vec.Lazy: traverse1 :: forall n f a b. Apply f => (a -> f b) -> Vec (S n) a -> f (Vec (S n) b)
+ Data.Vec.Lazy: traverse1 :: forall n f a b. Apply f => (a -> f b) -> Vec ( 'S n) a -> f (Vec ( 'S n) b)
- Data.Vec.Lazy.Inline: [:::] :: a -> Vec n a -> Vec (S n) a
+ Data.Vec.Lazy.Inline: [:::] :: a -> Vec n a -> Vec ( 'S n) a
- Data.Vec.Lazy.Inline: [VNil] :: Vec Z a
+ Data.Vec.Lazy.Inline: [VNil] :: Vec 'Z a
- Data.Vec.Lazy.Inline: _Cons :: Iso (Vec (S n) a) (Vec (S n) b) (a, Vec n a) (b, Vec n b)
+ Data.Vec.Lazy.Inline: _Cons :: Iso (Vec ( 'S n) a) (Vec ( 'S n) b) (a, Vec n a) (b, Vec n b)
- Data.Vec.Lazy.Inline: _head :: Lens' (Vec (S n) a) a
+ Data.Vec.Lazy.Inline: _head :: Lens' (Vec ( 'S n) a) a
- Data.Vec.Lazy.Inline: _tail :: Lens' (Vec (S n) a) (Vec n a)
+ Data.Vec.Lazy.Inline: _tail :: Lens' (Vec ( 'S n) a) (Vec n a)
- Data.Vec.Lazy.Inline: cons :: a -> Vec n a -> Vec (S n) a
+ Data.Vec.Lazy.Inline: cons :: a -> Vec n a -> Vec ( 'S n) a
- Data.Vec.Lazy.Inline: empty :: Vec Z a
+ Data.Vec.Lazy.Inline: empty :: Vec 'Z a
- Data.Vec.Lazy.Inline: foldMap1 :: forall s a n. (Semigroup s, InlineInduction n) => (a -> s) -> Vec (S n) a -> s
+ Data.Vec.Lazy.Inline: foldMap1 :: forall s a n. (Semigroup s, InlineInduction n) => (a -> s) -> Vec ( 'S n) a -> s
- Data.Vec.Lazy.Inline: head :: Vec (S n) a -> a
+ Data.Vec.Lazy.Inline: head :: Vec ( 'S n) a -> a
- Data.Vec.Lazy.Inline: ifoldMap1 :: forall a n s. (Semigroup s, InlineInduction n) => (Fin (S n) -> a -> s) -> Vec (S n) a -> s
+ Data.Vec.Lazy.Inline: ifoldMap1 :: forall a n s. (Semigroup s, InlineInduction n) => (Fin ( 'S n) -> a -> s) -> Vec ( 'S n) a -> s
- Data.Vec.Lazy.Inline: singleton :: a -> Vec (S Z) a
+ Data.Vec.Lazy.Inline: singleton :: a -> Vec ( 'S 'Z) a
- Data.Vec.Lazy.Inline: tail :: Vec (S n) a -> Vec n a
+ Data.Vec.Lazy.Inline: tail :: Vec ( 'S n) a -> Vec n a
- Data.Vec.Lazy.Inline: traverse1 :: forall n f a b. (Apply f, InlineInduction n) => (a -> f b) -> Vec (S n) a -> f (Vec (S n) b)
+ Data.Vec.Lazy.Inline: traverse1 :: forall n f a b. (Apply f, InlineInduction n) => (a -> f b) -> Vec ( 'S n) a -> f (Vec ( 'S n) b)
- Data.Vec.Pull: _Cons :: Iso (Vec (S n) a) (Vec (S n) b) (a, Vec n a) (b, Vec n b)
+ Data.Vec.Pull: _Cons :: Iso (Vec ( 'S n) a) (Vec ( 'S n) b) (a, Vec n a) (b, Vec n b)
- Data.Vec.Pull: _head :: Lens' (Vec (S n) a) a
+ Data.Vec.Pull: _head :: Lens' (Vec ( 'S n) a) a
- Data.Vec.Pull: _tail :: Lens' (Vec (S n) a) (Vec n a)
+ Data.Vec.Pull: _tail :: Lens' (Vec ( 'S n) a) (Vec n a)
- Data.Vec.Pull: empty :: Vec Z a
+ Data.Vec.Pull: empty :: Vec 'Z a
- Data.Vec.Pull: foldMap1 :: (Semigroup s, SNatI n) => (a -> s) -> Vec (S n) a -> s
+ Data.Vec.Pull: foldMap1 :: (Semigroup s, SNatI n) => (a -> s) -> Vec ( 'S n) a -> s
- Data.Vec.Pull: head :: Vec (S n) a -> a
+ Data.Vec.Pull: head :: Vec ( 'S n) a -> a
- Data.Vec.Pull: ifoldMap1 :: (Semigroup s, SNatI n) => (Fin (S n) -> a -> s) -> Vec (S n) a -> s
+ Data.Vec.Pull: ifoldMap1 :: (Semigroup s, SNatI n) => (Fin ( 'S n) -> a -> s) -> Vec ( 'S n) a -> s
- Data.Vec.Pull: singleton :: a -> Vec (S Z) a
+ Data.Vec.Pull: singleton :: a -> Vec ( 'S 'Z) a
- Data.Vec.Pull: tail :: Vec (S n) a -> Vec n a
+ Data.Vec.Pull: tail :: Vec ( 'S n) a -> Vec n a
Files
- ChangeLog.md +6/−0
- src/Data/Vec/Lazy.hs +0/−4
- src/Data/Vec/Pull.hs +0/−4
- vec.cabal +37/−21
ChangeLog.md view
@@ -1,4 +1,10 @@ # Revision history for boring++## 0.1++- Reverse dependencies with `boring`.+- GHC-8.4.1 support+ ## 0 - First version. Released on an unsuspecting world.
src/Data/Vec/Lazy.hs view
@@ -84,7 +84,6 @@ import Control.Applicative (Applicative (..)) import Control.DeepSeq (NFData (..)) import Control.Lens ((<&>))-import Data.Boring (Boring (..)) import Data.Distributive (Distributive (..)) import Data.Fin (Fin) import Data.Functor.Apply (Apply (..))@@ -191,9 +190,6 @@ instance (Monoid a, N.SNatI n) => Monoid (Vec n a) where mempty = pure mempty mappend = zipWith mappend--instance n ~ 'N.Z => Boring (Vec n a) where- boring = VNil instance Apply (Vec n) where (<.>) = zipWith ($)
src/Data/Vec/Pull.hs view
@@ -63,7 +63,6 @@ import Control.Applicative (Applicative (..)) import Control.Lens ((<&>))-import Data.Boring (Boring (..)) import Data.Distributive (Distributive (..)) import Data.Fin (Fin) import Data.Functor.Apply (Apply (..))@@ -126,9 +125,6 @@ instance Monoid a => Monoid (Vec n a) where mempty = Vec mempty Vec a `mappend` Vec b = Vec (mappend a b)--instance n ~ 'N.Z => Boring (Vec n a) where- boring = empty instance Apply (Vec n) where (<.>) = zipWith ($)
vec.cabal view
@@ -1,13 +1,13 @@ name: vec-version: 0-synopsis: Nat, Fin and Vec types.+version: 0.1+synopsis: Vec: length-indexed (sized) list description:- This package provides length indexed lists, i.e. 'Vec'.+ This package provides length-indexed (sized) lists, also known as vectors. . @ data Vec n a where- VNil :: Vec 'Nat.Z a- (:::) :: a -> Vec n a -> Vec ('Nat.S n) a+ \ VNil :: Vec 'Nat.Z a+ \ (:::) :: a -> Vec n a -> Vec ('Nat.S n) a @ . The functions are implemented in three flavours:@@ -23,16 +23,29 @@ As best approach depends on the application, @vec@ doesn't do any magic transformation. Benchmark your code. .- Differences to other packages:+ This package uses [fin](https://hackage.haskell.org/package/fin), i.e. not @GHC.TypeLits@, for indexes. .- * [linear](http://hackage.haskell.org/package/linear) has 'V' type,+ See [Hasochism: the pleasure and pain of dependently typed haskell programming](https://doi.org/10.1145/2503778.2503786)+ by Sam Lindley and Conor McBride for answers to /how/ and /why/.+ Read [APLicative Programming with Naperian Functors](https://doi.org/10.1007/978-3-662-54434-1_21)+ by Jeremy Gibbons for (not so) different ones.+ .+ === Similar packages+ .+ * [linear](https://hackage.haskell.org/package/linear) has 'V' type, which uses 'Vector' from @vector@ package as backing store.- `Vec` is a real GADT, but tries to provide as many useful instances (upto @lens@).+ @Vec@ is a real GADT, but tries to provide as many useful instances (upto @lens@). .- * [sized-vector](http://hackage.haskell.org/package/sized-vector) depends- on @singletons@ package. `vec` isn't light on dependencies either,+ * [vector-sized](https://hackage.haskell.org/package/vector-sized)+ Great package using @GHC.TypeLits@. Current version (0.6.1.0) uses+ @finite-typelits@ and @Int@ indexes.+ .+ * [sized-vector](https://hackage.haskell.org/package/sized-vector) depends+ on @singletons@ package. @vec@ isn't light on dependencies either, but try to provide wide GHC support. .+ * [fixed-vector](https://hackage.haskell.org/package/fixed-vector)+ . * [sized](https://hackage.haskell.org/package/sized) also depends on a @singletons@ package. The @Sized f n a@ type is generalisation of @linear@'s @V@ for any @ListLike@.@@ -56,7 +69,8 @@ GHC==7.8.4, GHC==7.10.3, GHC==8.0.2,- GHC==8.2.1+ GHC==8.2.2,+ GHC==8.4.1 source-repository head type: git@@ -68,18 +82,20 @@ Data.Vec.Lazy.Inline Data.Vec.Pull build-depends:- adjunctions >=4.3 && <4.4,- base >=4.7 && <4.11,+ adjunctions >=4.4 && <4.5,+ base >=4.7 && <4.12, base-compat >=0.9.3 && <0.10,- boring >=0 && <0.1, deepseq >=1.3.0.2 && <1.5, distributive >=0.5.3 && <0.6,- fin >=0 && <0.1,- hashable >=1.2.6.1 && <1.3,- lens >=4.15.4 && <4.16,- semigroupoids >=5.2.1 && <5.3,- semigroups >=0.18.3 && <0.18.4+ fin >=0.0.1 && <0.1,+ hashable >=1.2.7.0 && <1.3,+ lens >=4.16 && <4.17,+ semigroupoids >=5.2.2 && <5.3 + if !impl(ghc >= 8.0)+ build-depends:+ semigroups >=0.18.4 && <0.18.5+ ghc-options: -Wall -fprint-explicit-kinds hs-source-dirs: src other-extensions:@@ -100,7 +116,7 @@ fin, vec, tagged,- inspection-testing >= 0.1.1.2 && <0.2+ inspection-testing >= 0.2.0.1 && <0.3 if !impl(ghc >= 8.0) buildable: False@@ -127,4 +143,4 @@ fin, vec, vector,- criterion >= 1.2.3.0 && <1.3+ criterion >= 1.4.0.0 && <1.5