Copyright | (c) 2019 Andrew Lelechenko |
---|---|
License | BSD3 |
Maintainer | Andrew Lelechenko <andrew.lelechenko@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
Wrapper for immutable vectors, equipped with a Vector
instance.
>>>
Forward (Data.Vector.fromList [0..100]) Data.Vector.Generic.! 10
10>>>
Backward (Data.Vector.fromList [0..100]) Data.Vector.Generic.! 10
90
Forward !(v a) | Behaves as an original vector in respect to |
Backward !(v a) | Behaves as a reversed vector in respect to |
Instances
Vector v a => Vector (Rotcev v) a Source # | |
Defined in Data.Vector.Rotcev basicUnsafeFreeze :: PrimMonad m => Mutable (Rotcev v) (PrimState m) a -> m (Rotcev v a) # basicUnsafeThaw :: PrimMonad m => Rotcev v a -> m (Mutable (Rotcev v) (PrimState m) a) # basicLength :: Rotcev v a -> Int # basicUnsafeSlice :: Int -> Int -> Rotcev v a -> Rotcev v a # basicUnsafeIndexM :: Monad m => Rotcev v a -> Int -> m a # basicUnsafeCopy :: PrimMonad m => Mutable (Rotcev v) (PrimState m) a -> Rotcev v a -> m () # | |
Eq (v a) => Eq (Rotcev v a) Source # | |
Ord (v a) => Ord (Rotcev v a) Source # | |
Show (v a) => Show (Rotcev v a) Source # | |
type Mutable (Rotcev v) Source # | |
Defined in Data.Vector.Rotcev |
reverse :: Rotcev v a -> Rotcev v a Source #
Reverse an immutable vector in O(1) time and space.
>>>
vec = Data.Vector.Generic.fromList [0..100] :: Rotcev Data.Vector.Vector Int
>>>
reverse vec Data.Vector.Generic.! 10
90
Wrapper for mutable vectors, equipped with a MVector
instance.
MForward !(Mutable v s a) | Behaves as an original vector in respect to |
MBackward !(Mutable v s a) | Behaves as a reversed vector in respect to |