Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data MVector s a
- data Vector a
- length :: (Storable a, Endian a) => Vector a -> Int
- null :: (Storable a, Endian a) => Vector a -> Bool
- (!) :: (Storable a, Endian a) => Vector a -> Int -> a
- (!?) :: (Storable a, Endian a) => Vector a -> Int -> Maybe a
- head :: (Storable a, Endian a) => Vector a -> a
- last :: (Storable a, Endian a) => Vector a -> a
- unsafeIndex :: (Storable a, Endian a) => Vector a -> Int -> a
- unsafeHead :: (Storable a, Endian a) => Vector a -> a
- unsafeLast :: (Storable a, Endian a) => Vector a -> a
- indexM :: (Storable a, Endian a, Monad m) => Vector a -> Int -> m a
- headM :: (Storable a, Endian a, Monad m) => Vector a -> m a
- lastM :: (Storable a, Endian a, Monad m) => Vector a -> m a
- unsafeIndexM :: (Storable a, Endian a, Monad m) => Vector a -> Int -> m a
- unsafeHeadM :: (Storable a, Endian a, Monad m) => Vector a -> m a
- unsafeLastM :: (Storable a, Endian a, Monad m) => Vector a -> m a
- slice :: (Storable a, Endian a) => Int -> Int -> Vector a -> Vector a
- init :: (Storable a, Endian a) => Vector a -> Vector a
- tail :: (Storable a, Endian a) => Vector a -> Vector a
- take :: (Storable a, Endian a) => Int -> Vector a -> Vector a
- drop :: (Storable a, Endian a) => Int -> Vector a -> Vector a
- splitAt :: (Storable a, Endian a) => Int -> Vector a -> (Vector a, Vector a)
- unsafeSlice :: (Storable a, Endian a) => Int -> Int -> Vector a -> Vector a
- unsafeInit :: (Storable a, Endian a) => Vector a -> Vector a
- unsafeTail :: (Storable a, Endian a) => Vector a -> Vector a
- unsafeTake :: (Storable a, Endian a) => Int -> Vector a -> Vector a
- unsafeDrop :: (Storable a, Endian a) => Int -> Vector a -> Vector a
- empty :: (Storable a, Endian a) => Vector a
- singleton :: (Storable a, Endian a) => a -> Vector a
- replicate :: (Storable a, Endian a) => Int -> a -> Vector a
- generate :: (Storable a, Endian a) => Int -> (Int -> a) -> Vector a
- iterateN :: (Storable a, Endian a) => Int -> (a -> a) -> a -> Vector a
- replicateM :: (Monad m, Storable a, Endian a) => Int -> m a -> m (Vector a)
- generateM :: (Monad m, Storable a, Endian a) => Int -> (Int -> m a) -> m (Vector a)
- iterateNM :: (Monad m, Storable a, Endian a) => Int -> (a -> m a) -> a -> m (Vector a)
- create :: (Storable a, Endian a) => (forall s. ST s (MVector s a)) -> Vector a
- createT :: (Traversable f, Storable a, Endian a) => (forall s. ST s (f (MVector s a))) -> f (Vector a)
- unfoldr :: (Storable a, Endian a) => (b -> Maybe (a, b)) -> b -> Vector a
- unfoldrN :: (Storable a, Endian a) => Int -> (b -> Maybe (a, b)) -> b -> Vector a
- unfoldrM :: (Monad m, Storable a, Endian a) => (b -> m (Maybe (a, b))) -> b -> m (Vector a)
- unfoldrNM :: (Monad m, Storable a, Endian a) => Int -> (b -> m (Maybe (a, b))) -> b -> m (Vector a)
- constructN :: (Storable a, Endian a) => Int -> (Vector a -> a) -> Vector a
- constructrN :: (Storable a, Endian a) => Int -> (Vector a -> a) -> Vector a
- enumFromN :: (Storable a, Endian a, Num a) => a -> Int -> Vector a
- enumFromStepN :: (Storable a, Endian a, Num a) => a -> a -> Int -> Vector a
- enumFromTo :: (Storable a, Endian a, Enum a) => a -> a -> Vector a
- enumFromThenTo :: (Storable a, Endian a, Enum a) => a -> a -> a -> Vector a
- unsafeFromForeignPtr :: (Storable a, Endian a) => ForeignPtr a -> Int -> Int -> Vector a
- unsafeFromForeignPtr0 :: (Storable a, Endian a) => ForeignPtr a -> Int -> Vector a
- unsafeToForeignPtr :: (Storable a, Endian a) => Vector a -> (ForeignPtr a, Int, Int)
- unsafeToForeignPtr0 :: (Storable a, Endian a) => Vector a -> (ForeignPtr a, Int)
- unsafeWith :: (Storable a, Endian a) => Vector a -> (Ptr a -> IO b) -> IO b
Documentation
Instances
Instances
(Storable a, Endian a) => Vector Vector a Source # | |
Defined in Internal.Vector basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) a -> m (Vector a) # basicUnsafeThaw :: PrimMonad m => Vector a -> m (Mutable Vector (PrimState m) a) # basicLength :: Vector a -> Int # basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a # basicUnsafeIndexM :: Monad m => Vector a -> Int -> m a # basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) a -> Vector a -> m () # | |
(Storable a, Endian a) => IsList (Vector a) Source # | |
(Storable a, Eq a) => Eq (Vector a) Source # | |
(Read a, Storable a, Endian a) => Read (Vector a) Source # | |
(Show a, Storable a, Endian a) => Show (Vector a) Source # | |
Storable a => Semigroup (Vector a) Source # | |
Storable a => Monoid (Vector a) Source # | |
NFData (Vector a) Source # | |
Defined in Internal.Vector | |
type Mutable Vector Source # | |
Defined in Internal.Vector | |
type Item (Vector a) Source # | |
Defined in Internal.Vector |
Accessors
Length information
Indexing
unsafeHead :: (Storable a, Endian a) => Vector a -> a Source #
unsafeLast :: (Storable a, Endian a) => Vector a -> a Source #
Monadic indexing
Extracting subvectors (slicing)
Construction
Initialisation
Monadic initialisation
createT :: (Traversable f, Storable a, Endian a) => (forall s. ST s (f (MVector s a))) -> f (Vector a) Source #
Unfolding
unfoldrM :: (Monad m, Storable a, Endian a) => (b -> m (Maybe (a, b))) -> b -> m (Vector a) Source #
unfoldrNM :: (Monad m, Storable a, Endian a) => Int -> (b -> m (Maybe (a, b))) -> b -> m (Vector a) Source #
Enumeration
Raw pointers
unsafeFromForeignPtr :: (Storable a, Endian a) => ForeignPtr a -> Int -> Int -> Vector a Source #
unsafeFromForeignPtr0 :: (Storable a, Endian a) => ForeignPtr a -> Int -> Vector a Source #
unsafeToForeignPtr :: (Storable a, Endian a) => Vector a -> (ForeignPtr a, Int, Int) Source #
unsafeToForeignPtr0 :: (Storable a, Endian a) => Vector a -> (ForeignPtr a, Int) Source #
unsafeWith :: (Storable a, Endian a) => Vector a -> (Ptr a -> IO b) -> IO b Source #
Like unsafeWith
, but note well: the pointer will point to the value
in its *wire format*, which may not match the host cpu endianness.