Safe Haskell | Unsafe |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Array n a = Array (SmallArray a)
- singleton :: a -> Array Sz1 a
- unsafeSmallArrayToArray :: SmallArray a -> Array n a
- arrayToSmallArray :: Array n a -> SmallArray a
- getSingleton# :: Array Sz1 a -> (#a#)
- getSingletonA :: Applicative f => Array Sz1 a -> f a
- splitArray :: Size n -> Array (Twice n) a -> (Array n a, Array n a)
- splitSmallArray# :: Int -> SmallArray a -> (#SmallArray# a, SmallArray# a#)
- append :: Size n -> Array n a -> Array n a -> Array (Twice n) a
- appendSmallArrays :: Int -> SmallArray a -> SmallArray a -> SmallArray a
- createSmallArray :: Int -> a -> (forall s. SmallMutableArray s a -> ST s ()) -> SmallArray a
- arraySplitListN :: Size n -> [a] -> (Array n a, [a])
- smallArraySplitListN :: Int -> [a] -> (SmallArray a, [a])
- fromList :: Size n -> [a] -> Array n a
Documentation
Array (SmallArray a) |
Instances
Functor (Array n) Source # | |
Foldable (Array n) Source # | |
Defined in Data.CompactSequence.Internal.Array fold :: Monoid m => Array n m -> 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 # | |
Traversable (Array n) Source # | |
unsafeSmallArrayToArray :: SmallArray a -> Array n a Source #
Unsafely convert a SmallArray
of size n
to an
. This is genuinely unsafe: if
Array
nn
is greater than the true array size, then
some operation will eventually violate memory safety.
arrayToSmallArray :: Array n a -> SmallArray a Source #
getSingleton# :: Array Sz1 a -> (#a#) Source #
getSingletonA :: Applicative f => Array Sz1 a -> f a Source #
splitSmallArray# :: Int -> SmallArray a -> (#SmallArray# a, SmallArray# a#) Source #
append :: Size n -> Array n a -> Array n a -> Array (Twice n) a Source #
Append two arrays of the same size. We take the size
of the argument arrays so we can build the result array
before loading the first argument array into cache. Is
this the right approach? Not sure. We *certainly* don't
want to just use <>
, because
appendSmallArrays :: Int -> SmallArray a -> SmallArray a -> SmallArray a Source #
createSmallArray :: Int -> a -> (forall s. SmallMutableArray s a -> ST s ()) -> SmallArray a Source #
arraySplitListN :: Size n -> [a] -> (Array n a, [a]) Source #
smallArraySplitListN :: Int -> [a] -> (SmallArray a, [a]) Source #