-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Vectors with O(1) reverse -- -- A wrapper for an arbitrary Vector with O(1) reverse. -- Instead of creating a copy, it just flips a flag, which inverts -- indexing. Imagine it as a vector with a switch between -- little-endianness and big-endianness. @package vector-rotcev @version 0.1.0.2 -- | A wrapper for an arbitrary Vector with O(1) reverse. -- Instead of creating a copy, it just flips a flag, which inverts -- indexing. Imagine it as a vector with a switch between -- little-endianness and big-endianness. module Data.Vector.Rotcev -- | 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
--   
data Rotcev v a -- | Behaves as an original vector in respect to Vector operations. Forward :: !v a -> Rotcev v a -- | Behaves as a reversed vector in respect to Vector operations. Backward :: !v a -> Rotcev v a -- | 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
--   
reverse :: Rotcev v a -> Rotcev v a -- | Unwrap Rotcev, extracting an underlying vector. This takes O(1) -- for Forward, but full O(n) time for Backward case, so it -- would rather be avoided in intermediate computations. Instead leverage -- opportunities, provided by generic Vector and MVector -- instances. unRotcev :: Vector v a => Rotcev v a -> v a -- | Wrapper for mutable vectors, equipped with a MVector instance. data MRotcev v s a -- | Behaves as an original vector in respect to MVector operations. MForward :: !Mutable v s a -> MRotcev v s a -- | Behaves as a reversed vector in respect to MVector operations. MBackward :: !Mutable v s a -> MRotcev v s a -- | Reverse a mutable vector in O(1) time and space. mreverse :: MRotcev v s a -> MRotcev v s a instance GHC.Show.Show (v a) => GHC.Show.Show (Data.Vector.Rotcev.Rotcev v a) instance GHC.Classes.Ord (v a) => GHC.Classes.Ord (Data.Vector.Rotcev.Rotcev v a) instance GHC.Classes.Eq (v a) => GHC.Classes.Eq (Data.Vector.Rotcev.Rotcev v a) instance Data.Vector.Generic.Mutable.Base.MVector (Data.Vector.Generic.Base.Mutable v) a => Data.Vector.Generic.Mutable.Base.MVector (Data.Vector.Rotcev.MRotcev v) a instance Data.Vector.Generic.Base.Vector v a => Data.Vector.Generic.Base.Vector (Data.Vector.Rotcev.Rotcev v) a