-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Unified interface for primitive arrays
--
-- This package provides a typeclass Contiguous that offers a
-- unified interface to working with Array, PrimArray, and
-- UnliftedArray.
@package contiguous
@version 0.1.0.0
module Data.Primitive.Contiguous
-- | A contiguous array of elements.
class Contiguous (arr :: Type -> Type) where {
type family Mutable arr = (r :: Type -> Type -> Type) | r -> arr;
type family Element arr :: Type -> Constraint;
}
empty :: Contiguous arr => arr a
new :: (Contiguous arr, Element arr b) => Int -> ST s (Mutable arr s b)
index :: (Contiguous arr, Element arr b) => arr b -> Int -> b
index# :: (Contiguous arr, Element arr b) => arr b -> Int -> (# b #)
indexM :: (Contiguous arr, Element arr b, Monad m) => arr b -> Int -> m b
read :: (Contiguous arr, Element arr b) => Mutable arr s b -> Int -> ST s b
write :: (Contiguous arr, Element arr b) => Mutable arr s b -> Int -> b -> ST s ()
resize :: (Contiguous arr, Element arr b) => Mutable arr s b -> Int -> ST s (Mutable arr s b)
size :: (Contiguous arr, Element arr b) => arr b -> Int
sizeMutable :: (Contiguous arr, Element arr b) => Mutable arr s b -> ST s Int
unsafeFreeze :: Contiguous arr => Mutable arr s b -> ST s (arr b)
copy :: (Contiguous arr, Element arr b) => Mutable arr s b -> Int -> arr b -> Int -> Int -> ST s ()
copyMutable :: (Contiguous arr, Element arr b) => Mutable arr s b -> Int -> Mutable arr s b -> Int -> Int -> ST s ()
clone :: (Contiguous arr, Element arr b) => arr b -> Int -> Int -> arr b
cloneMutable :: (Contiguous arr, Element arr b) => Mutable arr s b -> Int -> Int -> ST s (Mutable arr s b)
foldr :: (Contiguous arr, Element arr b) => (b -> c -> c) -> c -> arr b -> c
equals :: (Contiguous arr, Element arr b, Eq b) => arr b -> arr b -> Bool
unlift :: Contiguous arr => arr b -> ArrayArray#
lift :: Contiguous arr => ArrayArray# -> arr b
class Always a
map :: (Contiguous arr, Element arr b, Element arr c) => (b -> c) -> arr b -> arr c
foldl' :: (Contiguous arr, Element arr a) => (b -> a -> b) -> b -> arr a -> b
foldr' :: (Contiguous arr, Element arr a) => (a -> b -> b) -> b -> arr a -> b
foldMap' :: (Contiguous arr, Element arr a, Monoid m) => (a -> m) -> arr a -> m
instance Data.Primitive.Contiguous.Contiguous Data.Primitive.PrimArray.PrimArray
instance Data.Primitive.Contiguous.Contiguous Data.Primitive.Array.Array
instance Data.Primitive.Contiguous.Contiguous Data.Primitive.UnliftedArray.UnliftedArray
instance Data.Primitive.Contiguous.Always a