Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- data Array sh a
- shape :: Array sh a -> sh
- reshape :: (C sh0, C sh1) => sh1 -> Array sh0 a -> Array sh1 a
- mapShape :: (C sh0, C sh1) => (sh0 -> sh1) -> Array sh0 a -> Array sh1 a
- accessMaybe :: Indexed sh => Array sh a -> Index sh -> Maybe a
- (!) :: Indexed sh => Array sh a -> Index sh -> a
- toList :: C sh => Array sh a -> [a]
- fromList :: C sh => sh -> [a] -> Array sh a
- vectorFromList :: [a] -> Array (ZeroBased Int) a
- toAssociations :: Indexed sh => Array sh a -> [(Index sh, a)]
- fromMap :: Ord k => Map k a -> Array (Set k) a
- toMap :: Ord k => Array (Set k) a -> Map k a
- fromTuple :: NestedTuple tuple => DataTuple tuple a -> Array (NestedTuple ixtype tuple) a
- toTuple :: NestedTuple tuple => Array (NestedTuple ixtype tuple) a -> DataTuple tuple a
- fromRecord :: Traversable f => f a -> Array (Record f) a
- toRecord :: Traversable f => Array (Record f) a -> f a
- fromContainer :: C f => f a -> Array (Shape f) a
- toContainer :: C f => Array (Shape f) a -> f a
- indices :: Indexed sh => sh -> Array sh (Index sh)
- replicate :: C sh => sh -> a -> Array sh a
- cartesian :: (C sh0, C sh1) => Array sh0 a -> Array sh1 b -> Array (sh0, sh1) (a, b)
- map :: C sh => (a -> b) -> Array sh a -> Array sh b
- zipWith :: (C sh, Eq sh) => (a -> b -> c) -> Array sh a -> Array sh b -> Array sh c
- (//) :: Indexed sh => Array sh a -> [(Index sh, a)] -> Array sh a
- accumulate :: Indexed sh => (a -> b -> a) -> Array sh a -> [(Index sh, b)] -> Array sh a
- fromAssociations :: Indexed sh => a -> sh -> [(Index sh, a)] -> Array sh a
- pick :: (Indexed sh0, C sh1) => Array (sh0, sh1) a -> Index sh0 -> Array sh1 a
- append :: (C shx, C shy) => Array shx a -> Array shy a -> Array (shx ::+ shy) a
- take :: Integral n => n -> Array (ZeroBased n) a -> Array (ZeroBased n) a
- drop :: Integral n => n -> Array (ZeroBased n) a -> Array (ZeroBased n) a
- takeLeft :: (C sh0, C sh1) => Array (sh0 ::+ sh1) a -> Array sh0 a
- takeRight :: (C sh0, C sh1) => Array (sh0 ::+ sh1) a -> Array sh1 a
- split :: (C sh0, C sh1) => Array (sh0 ::+ sh1) a -> (Array sh0 a, Array sh1 a)
- takeCenter :: (C sh0, C sh1, C sh2) => Array (sh0 ::+ (sh1 ::+ sh2)) a -> Array sh1 a
Documentation
Instances
C sh => Foldable (Array sh) Source # | |
Defined in Data.Array.Comfort.Boxed.Unchecked fold :: Monoid m => Array sh m -> m # foldMap :: Monoid m => (a -> m) -> Array sh a -> m # foldMap' :: Monoid m => (a -> m) -> Array sh a -> m # foldr :: (a -> b -> b) -> b -> Array sh a -> b # foldr' :: (a -> b -> b) -> b -> Array sh a -> b # foldl :: (b -> a -> b) -> b -> Array sh a -> b # foldl' :: (b -> a -> b) -> b -> Array sh a -> b # foldr1 :: (a -> a -> a) -> Array sh a -> a # foldl1 :: (a -> a -> a) -> Array sh a -> a # elem :: Eq a => a -> Array sh a -> Bool # maximum :: Ord a => Array sh a -> a # minimum :: Ord a => Array sh a -> a # | |
C sh => Traversable (Array sh) Source # | |
Defined in Data.Array.Comfort.Boxed.Unchecked | |
Static sh => Applicative (Array sh) Source # | We must restrict |
C sh => Functor (Array sh) Source # | |
(C sh, Show sh, Show a) => Show (Array sh a) Source # | |
(C sh, NFData sh, NFData a) => NFData (Array sh a) Source # | |
Defined in Data.Array.Comfort.Boxed.Unchecked | |
(Eq sh, Eq a) => Eq (Array sh a) Source # | |
fromRecord :: Traversable f => f a -> Array (Record f) a Source #
pick :: (Indexed sh0, C sh1) => Array (sh0, sh1) a -> Index sh0 -> Array sh1 a Source #
QC.forAll genArray2 $ \xs -> let shape = Array.shape xs in Shape.size shape > 0 QC.==> QC.forAll (QC.elements $ Shape.indices shape) $ \(ix0,ix1) -> Array.pick xs ix0 ! ix1 == xs!(ix0,ix1)
take :: Integral n => n -> Array (ZeroBased n) a -> Array (ZeroBased n) a Source #
\(QC.NonNegative n) (ArrayChar x) -> x == Array.mapShape (Shape.ZeroBased . Shape.size) (Array.append (Array.take n x) (Array.drop n x))
drop :: Integral n => n -> Array (ZeroBased n) a -> Array (ZeroBased n) a Source #
\(QC.NonNegative n) (ArrayChar x) -> x == Array.mapShape (Shape.ZeroBased . Shape.size) (Array.append (Array.take n x) (Array.drop n x))