orthotope 0.1.4.0 → 0.1.4.1
raw patch · 7 files changed
+24/−7 lines, 7 filesdep ~QuickCheckdep ~basedep ~deepseqPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: QuickCheck, base, deepseq, vector
API changes (from Hackage documentation)
Files
- Data/Array/Internal.hs +2/−0
- Data/Array/Internal/Ranked.hs +2/−0
- Data/Array/Internal/RankedG.hs +1/−0
- Data/Array/Internal/RankedS.hs +4/−0
- Data/Array/Internal/ShapedS.hs +4/−0
- README.md +1/−0
- orthotope.cabal +10/−7
Data/Array/Internal.hs view
@@ -144,6 +144,7 @@ -- When shapes match, we can be efficient and use loop-fused comparisons instead -- of materializing a list.+{-# INLINABLE equalT #-} equalT :: (Vector v, VecElem v a, Eq a, Eq (v a)) => ShapeL -> T v a -> T v a -> Bool equalT s x y | strides x == strides y@@ -152,6 +153,7 @@ | otherwise = toVectorT s x == toVectorT s y -- Note this assumes the shape is the same for both Vectors.+{-# INLINABLE compareT #-} compareT :: (Vector v, VecElem v a, Ord a, Ord (v a)) => ShapeL -> T v a -> T v a -> Ordering compareT s x y = compare (toVectorT s x) (toVectorT s y)
Data/Array/Internal/Ranked.hs view
@@ -111,6 +111,7 @@ -- | Convert from a list with the elements given in the linearization order. -- Fails if the given shape does not have the same number of elements as the list. -- O(n) time.+{-# INLINABLE fromList #-} fromList :: forall n a . (KnownNat n) => ShapeL -> [a] -> Array n a fromList ss = A . G.fromList ss @@ -122,6 +123,7 @@ -- | Convert from a vector with the elements given in the linearization order. -- Fails if the given shape does not have the same number of elements as the list. -- O(1) time.+{-# INLINABLE fromVector #-} fromVector :: forall n a . (KnownNat n) => ShapeL -> V.Vector a -> Array n a fromVector ss = A . G.fromVector ss
Data/Array/Internal/RankedG.hs view
@@ -395,6 +395,7 @@ subArraysT osh t where (osh, ish) = splitAt (valueOf @n) sh +{-# INLINABLE ravelOuter #-} ravelOuter :: (Vector v, VecElem v a, KnownNat m) => ShapeL -> [Array n v a] -> Array m v a ravelOuter _ [] = error "ravelOuter: empty list" ravelOuter osh as | not $ allSame shs = error $ "ravelOuter: non-conforming inner dimensions: " ++ show shs
Data/Array/Internal/RankedS.hs view
@@ -141,6 +141,7 @@ -- | Change the shape of an array. Fails if the arrays have different number of elements. -- O(n) or O(1) time.+{-# INLINABLE reshape #-} reshape :: (Unbox a, KnownNat n, KnownNat n') => ShapeL -> Array n a -> Array n' a reshape s = A . G.reshape s . unA @@ -171,6 +172,7 @@ -- | Map over the array elements. -- O(n) time.+{-# INLINABLE mapA #-} mapA :: (Unbox a, Unbox b) => (a -> b) -> Array n a -> Array n b mapA f = A . G.mapA f . unA@@ -196,12 +198,14 @@ -- Fails if the transposition argument is not a permutation of the numbers -- [0..r-1], where r is the rank of the array. -- O(1) time.+{-# INLINABLE transpose #-} transpose :: (KnownNat n) => [Int] -> Array n a -> Array n a transpose is = A . G.transpose is . unA -- | Append two arrays along the outermost dimension. -- All dimensions, except the outermost, must be the same. -- O(n) time.+{-# INLINABLE append #-} append :: (Unbox a, KnownNat n) => Array n a -> Array n a -> Array n a append x y = A $ G.append (unA x) (unA y)
Data/Array/Internal/ShapedS.hs view
@@ -142,6 +142,7 @@ -- | Change the shape of an array. Type error if the arrays have different number of elements. -- O(n) or O(1) time.+{-# INLINABLE reshape #-} reshape :: forall sh' sh a . (Unbox a, Shape sh, Shape sh', Size sh ~ Size sh') => Array sh a -> Array sh' a reshape = A . G.reshape . unA@@ -174,6 +175,7 @@ -- | Map over the array elements. -- O(n) time.+{-# INLINABLE mapA #-} mapA :: (Unbox a, Unbox b, Shape sh) => (a -> b) -> Array sh a -> Array sh b mapA f = A . G.mapA f . unA @@ -197,6 +199,7 @@ -- Fails if the transposition argument is not a permutation of the numbers -- [0..r-1], where r is the rank of the array. -- O(1) time.+{-# INLINABLE transpose #-} transpose :: forall is sh a . (Permutation is, Rank is <= Rank sh, Shape sh, Shape is, KnownNat (Rank sh)) => Array sh a -> Array (Permute is sh) a@@ -205,6 +208,7 @@ -- | Append two arrays along the outermost dimension. -- All dimensions, except the outermost, must be the same. -- O(n) time.+{-# INLINABLE append #-} append :: (Unbox a, Shape sh, KnownNat m, KnownNat n, KnownNat (m+n)) => Array (m ': sh) a -> Array (n ': sh) a -> Array (m+n ': sh) a append x y = A $ G.append (unA x) (unA y)
README.md view
@@ -250,3 +250,4 @@ 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ```+
orthotope.cabal view
@@ -1,10 +1,11 @@ name: orthotope-version: 0.1.4.0+version: 0.1.4.1 synopsis: Multidimensional arrays inspired by APL license: Apache license-file: LICENSE copyright: 2018 Google Inc category: array+author: lennart@augustsson.net maintainer: lennart@augustsson.net description: Multidimensional arrays inspired by APL. The library contains a wide variety of structural@@ -17,6 +18,8 @@ LICENSE README.md +tested-with: GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2+ source-repository head type: git location: https://github.com/augustss/orthotope@@ -55,12 +58,12 @@ , Data.Array.Internal.ShapedS , Data.Array.Internal.ShapedU - build-depends: base >= 4.12 && < 4.18,+ build-depends: base >= 4.12 && < 4.20, QuickCheck >= 2.14.3 && < 2.15,- deepseq >= 1.4.6 && < 1.5,+ deepseq >= 1.4.4 && < 1.5, pretty >= 1.1.3 && < 1.2, dlist >= 1.0 && < 1.1,- vector >= 0.13.0 && < 0.14+ vector >= 0.12.0 && < 0.14 default-language: Haskell2010 @@ -85,9 +88,9 @@ base, deepseq, orthotope,+ QuickCheck,+ vector, HUnit >= 1.6.2 && < 1.7, test-framework >= 0.8.2 && < 0.9, test-framework-hunit >= 0.3.0 && < 0.4,- test-framework-quickcheck2 >= 0.3.0 && < 0.4,- QuickCheck >= 2.4.0.1,- vector+ test-framework-quickcheck2 >= 0.3.0 && < 0.4