Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Implementation of an array that uses type literals to store length. No explicit indexing is used for the input data. Supports arbitrary nesting of arrays.
Documentation
data Array (n :: Nat) t Source #
Implementation of an array that uses type literals to store length.
Instances
Foldable (Array n) Source # | |
Defined in Copilot.Core.Type.Array fold :: Monoid m => Array n m -> m # foldMap :: Monoid m => (a -> m) -> Array n a -> m # foldMap' :: Monoid m => (a -> m) -> Array n a -> m # foldr :: (a -> b -> b) -> b -> Array n a -> b # foldr' :: (a -> b -> b) -> b -> Array n a -> b # foldl :: (b -> a -> b) -> b -> Array n a -> b # foldl' :: (b -> a -> b) -> b -> Array n a -> b # foldr1 :: (a -> a -> a) -> Array n a -> a # foldl1 :: (a -> a -> a) -> Array n a -> a # elem :: Eq a => a -> Array n a -> Bool # maximum :: Ord a => Array n a -> a # minimum :: Ord a => Array n a -> a # | |
Show t => Show (Array n t) Source # | |
(Typeable t, Typed t, KnownNat n, Flatten t (InnerType t), Typed (InnerType t)) => Typed (Array n t) Source # | |
Defined in Copilot.Core.Type | |
Flatten a b => Flatten (Array n a) b Source # | Flattening of nested arrays. |
array :: forall n t. KnownNat n => [t] -> Array n t Source #
Smart array constructor that only type checks if the length of the given list matches the length of the array at type level.
size :: forall a n b. (Flatten a b, b ~ InnerType a) => Array n a -> Int Source #
Total number of elements in a possibly nested array.
Flattening or conversion of arrays to lists.
type family InnerType x where ... Source #
Association between an array and the type of the elements it contains.
arrayelems :: Array n a -> [a] Source #
Return the elemts of an array.