Skip to content

Commit

Permalink
Make argument order for fromList more consistent.
Browse files Browse the repository at this point in the history
This is a breaking API change, so bump version number.
  • Loading branch information
augustss committed Dec 25, 2024
1 parent 158014a commit b404b69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Data/Array/Internal/RankedS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ toList = G.toList . unA
-- Fails if the given shape does not have the same number of elements as the list.
-- O(n) time.
{-# INLINABLE fromList #-}
fromList :: (Unbox a, KnownNat n) => ShapeL -> [a] -> Array n a
fromList :: forall n a . (Unbox a, KnownNat n) => ShapeL -> [a] -> Array n a
fromList ss = A . G.fromList ss

-- | Convert to a vector with the elements in the linearization order.
-- O(n) or O(1) time (the latter if the vector is already in the linearization order).
{-# INLINABLE toVector #-}
toVector :: (Unbox a) => Array n a -> V.Vector a
toVector :: forall n a . (Unbox a) => Array n a -> V.Vector a
toVector = G.toVector . unA

-- | Convert from a vector with the elements given in the linearization order.
Expand Down
4 changes: 2 additions & 2 deletions Data/Array/Internal/RankedU.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ toList = G.toList . unA
-- | 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.
fromList :: (Unbox a, KnownNat n) => ShapeL -> [a] -> Array n a
fromList :: forall n a . (Unbox a, KnownNat n) => ShapeL -> [a] -> Array n a
fromList ss = A . G.fromList ss

-- | Convert to a vector with the elements in the linearization order.
-- O(n) or O(1) time (the latter if the vector is already in the linearization order).
toVector :: (Unbox a) => Array n a -> V.Vector a
toVector :: forall n a . (Unbox a) => Array n a -> V.Vector a
toVector = G.toVector . unA

-- | Convert from a vector with the elements given in the linearization order.
Expand Down
2 changes: 1 addition & 1 deletion orthotope.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: orthotope
version: 0.1.6.0
version: 0.1.7.0
synopsis: Multidimensional arrays inspired by APL
license: Apache
license-file: LICENSE
Expand Down

0 comments on commit b404b69

Please sign in to comment.