rio-0.1.22.0: A standard library for Haskell

Safe Haskell | Safe-Inferred
Language | Haskell2010

RIO.Seq

Contents

- Construction
  - Repetition
  - Iterative construction
- Deconstruction
  - Queries
  - Views
- Scans
- Sublists
  - Sequential searches
- Sorting
- Indexing
  - Indexing with predicates
- Folds
- Transformations
  - Zips

Description

`Seq`. Import as:

    import qualified RIO.Seq as Seq

Synopsis

- data Seq a where
  - pattern Empty :: Seq a
  - pattern (:<|) :: a -> Seq a -> Seq a
  - pattern (:|>) :: Seq a -> a -> Seq a
- empty :: Seq a
- singleton :: a -> Seq a
- (<|) :: a -> Seq a -> Seq a
- (|>) :: Seq a -> a -> Seq a
- (><) :: Seq a -> Seq a -> Seq a
- fromList :: [a] -> Seq a
- fromFunction :: Int -> (Int -> a) -> Seq a
- fromArray :: Ix i => Array i a -> Seq a
- replicate :: Int -> a -> Seq a
- replicateA :: Applicative f => Int -> f a -> f (Seq a)
- replicateM :: Applicative m => Int -> m a -> m (Seq a)
- cycleTaking :: Int -> Seq a -> Seq a
- iterateN :: Int -> (a -> a) -> a -> Seq a
- unfoldr :: (b -> Maybe (a, b)) -> b -> Seq a
- unfoldl :: (b -> Maybe (b, a)) -> b -> Seq a
- null :: Seq a -> Bool
- length :: Seq a -> Int
- data ViewL a
  - = EmptyL
  - | a :< (Seq a)
- viewl :: Seq a -> ViewL a
- data ViewR a
  - = EmptyR
  - | (Seq a) :> a
- viewr :: Seq a -> ViewR a
- scanl :: (a -> b -> a) -> a -> Seq b -> Seq a
- scanl1 :: (a -> a -> a) -> Seq a -> Seq a
- scanr :: (a -> b -> b) -> b -> Seq a -> Seq b
- scanr1 :: (a -> a -> a) -> Seq a -> Seq a
- tails :: Seq a -> Seq (Seq a)
- inits :: Seq a -> Seq (Seq a)
- chunksOf :: Int -> Seq a -> Seq (Seq a)
- takeWhileL :: (a -> Bool) -> Seq a -> Seq a
- takeWhileR :: (a -> Bool) -> Seq a -> Seq a
- dropWhileL :: (a -> Bool) -> Seq a -> Seq a
- dropWhileR :: (a -> Bool) -> Seq a -> Seq a
- spanl :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
- spanr :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
- breakl :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
- breakr :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
- partition :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
- filter :: (a -> Bool) -> Seq a -> Seq a
- sort :: Ord a => Seq a -> Seq a
- sortBy :: (a -> a -> Ordering) -> Seq a -> Seq a
- unstableSort :: Ord a => Seq a -> Seq a
- unstableSortBy :: (a -> a -> Ordering) -> Seq a -> Seq a
- lookup :: Int -> Seq a -> Maybe a
- (!?) :: Seq a -> Int -> Maybe a
- index :: Seq a -> Int -> a
- adjust :: (a -> a) -> Int -> Seq a -> Seq a
- adjust' :: (a -> a) -> Int -> Seq a -> Seq a
- update :: Int -> a -> Seq a -> Seq a
- take :: Int -> Seq a -> Seq a
- drop :: Int -> Seq a -> Seq a
- insertAt :: Int -> a -> Seq a -> Seq a
- deleteAt :: Int -> Seq a -> Seq a
- splitAt :: Int -> Seq a -> (Seq a, Seq a)
- elemIndexL :: Eq a => a -> Seq a -> Maybe Int
- elemIndicesL :: Eq a => a -> Seq a -> [Int]
- elemIndexR :: Eq a => a -> Seq a -> Maybe Int
- elemIndicesR :: Eq a => a -> Seq a -> [Int]
- findIndexL :: (a -> Bool) -> Seq a -> Maybe Int
- findIndicesL :: (a -> Bool) -> Seq a -> [Int]
- findIndexR :: (a -> Bool) -> Seq a -> Maybe Int
- findIndicesR :: (a -> Bool) -> Seq a -> [Int]
- foldMapWithIndex :: Monoid m => (Int -> a -> m) -> Seq a -> m
- foldlWithIndex :: (b -> Int -> a -> b) -> b -> Seq a -> b
- foldrWithIndex :: (Int -> a -> b -> b) -> b -> Seq a -> b
- mapWithIndex :: (Int -> a -> b) -> Seq a -> Seq b
- traverseWithIndex :: Applicative f => (Int -> a -> f b) -> Seq a -> f (Seq b)
- reverse :: Seq a -> Seq a
- intersperse :: a -> Seq a -> Seq a
- zip :: Seq a -> Seq b -> Seq (a, b)
- zipWith :: (a -> b -> c) -> Seq a -> Seq b -> Seq c
- zip3 :: Seq a -> Seq b -> Seq c -> Seq (a, b, c)
- zipWith3 :: (a -> b -> c -> d) -> Seq a -> Seq b -> Seq c -> Seq d
- zip4 :: Seq a -> Seq b -> Seq c -> Seq d -> Seq (a, b, c, d)
- zipWith4 :: (a -> b -> c -> d -> e) -> Seq a -> Seq b -> Seq c -> Seq d -> Seq e

# Documentation

data Seq a where #

Bundled Patterns

pattern Empty :: Seq a |
pattern (:<|) :: a -> Seq a -> Seq a |
pattern (:|>) :: Seq a -> a -> Seq a |

#### Instances

Instances details

MonadFix Seq |
Instance details Defined in Data.Sequence.Internal Methods mfix :: (a -> Seq a) -> Seq a
MonadZip Seq |
Instance details Defined in Data.Sequence.Internal Methods mzip :: Seq a -> Seq b -> Seq (a, b) mzipWith :: (a -> b -> c) -> Seq a -> Seq b -> Seq c munzip :: Seq (a, b) -> (Seq a, Seq b)
Foldable Seq |

Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => Seq m -> m #

foldMap :: Monoid m => (a -> m) -> Seq a -> m #

foldMap' :: Monoid m => (a -> m) -> Seq a -> m

foldr :: (a -> b -> b) -> b -> Seq a -> b #

foldr' :: (a -> b -> b) -> b -> Seq a -> b

foldl :: (b -> a -> b) -> b -> Seq a -> b #

foldl' :: (b -> a -> b) -> b -> Seq a -> b #

foldr1 :: (a -> a -> a) -> Seq a -> a #

foldl1 :: (a -> a -> a) -> Seq a -> a #

toList :: Seq a -> [a] #

null :: Seq a -> Bool #

length :: Seq a -> Int #

elem :: Eq a => a -> Seq a -> Bool #

maximum :: Ord a => Seq a -> a #

minimum :: Ord a => Seq a -> a #

sum :: Num a => Seq a -> a #

product :: Num a => Seq a -> a #

Eq1 Seq |
Instance details Defined in Data.Sequence.Internal Methods liftEq :: (a -> b -> Bool) -> Seq a -> Seq b -> Bool
Ord1 Seq |
Instance details Defined in Data.Sequence.Internal Methods liftCompare :: (a -> b -> Ordering) -> Seq a -> Seq b -> Ordering
Read1 Seq |
Instance details Defined in Data.Sequence.Internal Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Seq a) liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Seq a] liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Seq a) liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Seq a]
Show1 Seq |
Instance details Defined in Data.Sequence.Internal Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Seq a -> ShowS liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Seq a] -> ShowS
Traversable Seq |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> Seq a -> f (Seq b) # sequenceA :: Applicative f => Seq (f a) -> f (Seq a) # mapM :: Monad m => (a -> m b) -> Seq a -> m (Seq b) # sequence :: Monad m => Seq (m a) -> m (Seq a) #
Alternative Seq |
Instance details Defined in Data.Sequence.Internal Methods empty :: Seq a (<|>) :: Seq a -> Seq a -> Seq a # some :: Seq a -> Seq [a] # many :: Seq a -> Seq [a] #
Applicative Seq |
Instance details Defined in Data.Sequence.Internal Methods pure :: a -> Seq a # (<*>) :: Seq (a -> b) -> Seq a -> Seq b # liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c # (*>) :: Seq a -> Seq b -> Seq b # (<*) :: Seq a -> Seq b -> Seq a #
Functor Seq |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> Seq a -> Seq b # (<$) :: a -> Seq b -> Seq a #
Monad Seq |
Instance details Defined in Data.Sequence.Internal Methods (>>=) :: Seq a -> (a -> Seq b) -> Seq b # (>>) :: Seq a -> Seq b -> Seq b # return :: a -> Seq a #
MonadPlus Seq |
Instance details Defined in Data.Sequence.Internal Methods mzero :: Seq a # mplus :: Seq a -> Seq a -> Seq a #
UnzipWith Seq |
Instance details Defined in Data.Sequence.Internal Methods unzipWith' :: (x -> (a, b)) -> Seq x -> (Seq a, Seq b)
Hashable1 Seq | Since: hashable-1.3.4.0
Instance details Defined in Data.Hashable.Class Methods liftHashWithSalt :: (Int -> a -> Int) -> Int -> Seq a -> Int #
Lift a => Lift (Seq a :: Type) |
Instance details Defined in Data.Sequence.Internal Methods lift :: Quote m => Seq a -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => Seq a -> Code m (Seq a)
Data a => Data (Seq a) |

Instance details

Defined in Data.Sequence.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Seq a -> c (Seq a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Seq a) #

toConstr :: Seq a -> Constr #

dataTypeOf :: Seq a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Seq a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Seq a)) #

gmapT :: (forall b. Data b => b -> b) -> Seq a -> Seq a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Seq a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Seq a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Seq a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Seq a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Seq a -> m (Seq a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Seq a -> m (Seq a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Seq a -> m (Seq a) #

a ~ Char => IsString (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods fromString :: String -> Seq a #
Monoid (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods mempty :: Seq a # mappend :: Seq a -> Seq a -> Seq a # mconcat :: [Seq a] -> Seq a #
Semigroup (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods (<>) :: Seq a -> Seq a -> Seq a # sconcat :: NonEmpty (Seq a) -> Seq a stimes :: Integral b => b -> Seq a -> Seq a
IsList (Seq a) |
Instance details Defined in Data.Sequence.Internal Associated Types type Item (Seq a) Methods fromList :: [Item (Seq a)] -> Seq a fromListN :: Int -> [Item (Seq a)] -> Seq a toList :: Seq a -> [Item (Seq a)]
Read a => Read (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods readsPrec :: Int -> ReadS (Seq a) readList :: ReadS [Seq a] readPrec :: ReadPrec (Seq a) readListPrec :: ReadPrec [Seq a]
Show a => Show (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods showsPrec :: Int -> Seq a -> ShowS show :: Seq a -> String # showList :: [Seq a] -> ShowS
NFData a => NFData (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods rnf :: Seq a -> () #
Eq a => Eq (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods (==) :: Seq a -> Seq a -> Bool # (/=) :: Seq a -> Seq a -> Bool #
Ord a => Ord (Seq a) |
Instance details Defined in Data.Sequence.Internal Methods compare :: Seq a -> Seq a -> Ordering # (<) :: Seq a -> Seq a -> Bool # (<=) :: Seq a -> Seq a -> Bool # (>) :: Seq a -> Seq a -> Bool # (>=) :: Seq a -> Seq a -> Bool # max :: Seq a -> Seq a -> Seq a # min :: Seq a -> Seq a -> Seq a #
Hashable v => Hashable (Seq v) | Since: hashable-1.3.4.0
Instance details Defined in Data.Hashable.Class Methods hashWithSalt :: Int -> Seq v -> Int # hash :: Seq v -> Int #
type Item (Seq a) |
Instance details Defined in Data.Sequence.Internal type Item (Seq a) = a

# Construction

empty :: Seq a #

singleton :: a -> Seq a #

(<|) :: a -> Seq a -> Seq a #

(|>) :: Seq a -> a -> Seq a #

(><) :: Seq a -> Seq a -> Seq a #

fromList :: [a] -> Seq a #

fromFunction :: Int -> (Int -> a) -> Seq a #

fromArray :: Ix i => Array i a -> Seq a #

## Repetition

replicate :: Int -> a -> Seq a #

replicateA :: Applicative f => Int -> f a -> f (Seq a) #

replicateM :: Applicative m => Int -> m a -> m (Seq a) #

cycleTaking :: Int -> Seq a -> Seq a #

## Iterative construction

iterateN :: Int -> (a -> a) -> a -> Seq a #

unfoldr :: (b -> Maybe (a, b)) -> b -> Seq a #

unfoldl :: (b -> Maybe (b, a)) -> b -> Seq a #

# Deconstruction

Additional functions for deconstructing sequences are available via the `Foldable` instance of `Seq`.

## Queries

null :: Seq a -> Bool #

length :: Seq a -> Int #

## Views

data ViewL a #

Constructors

EmptyL |
a :< (Seq a) |

#### Instances

Instances details

Foldable ViewL |

Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => ViewL m -> m #

foldMap :: Monoid m => (a -> m) -> ViewL a -> m #

foldMap' :: Monoid m => (a -> m) -> ViewL a -> m

foldr :: (a -> b -> b) -> b -> ViewL a -> b #

foldr' :: (a -> b -> b) -> b -> ViewL a -> b

foldl :: (b -> a -> b) -> b -> ViewL a -> b #

foldl' :: (b -> a -> b) -> b -> ViewL a -> b #

foldr1 :: (a -> a -> a) -> ViewL a -> a #

foldl1 :: (a -> a -> a) -> ViewL a -> a #

toList :: ViewL a -> [a] #

null :: ViewL a -> Bool #

length :: ViewL a -> Int #

elem :: Eq a => a -> ViewL a -> Bool #

maximum :: Ord a => ViewL a -> a #

minimum :: Ord a => ViewL a -> a #

sum :: Num a => ViewL a -> a #

product :: Num a => ViewL a -> a #

Traversable ViewL |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> ViewL a -> f (ViewL b) # sequenceA :: Applicative f => ViewL (f a) -> f (ViewL a) # mapM :: Monad m => (a -> m b) -> ViewL a -> m (ViewL b) # sequence :: Monad m => ViewL (m a) -> m (ViewL a) #
Functor ViewL |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> ViewL a -> ViewL b # (<$) :: a -> ViewL b -> ViewL a #
Generic1 ViewL |
Instance details Defined in Data.Sequence.Internal Associated Types type Rep1 ViewL :: k -> Type Methods from1 :: forall (a :: k). ViewL a -> Rep1 ViewL a to1 :: forall (a :: k). Rep1 ViewL a -> ViewL a
Lift a => Lift (ViewL a :: Type) |
Instance details Defined in Data.Sequence.Internal Methods lift :: Quote m => ViewL a -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => ViewL a -> Code m (ViewL a)
Data a => Data (ViewL a) |

Instance details

Defined in Data.Sequence.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ViewL a -> c (ViewL a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ViewL a) #

toConstr :: ViewL a -> Constr #

dataTypeOf :: ViewL a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ViewL a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ViewL a)) #

gmapT :: (forall b. Data b => b -> b) -> ViewL a -> ViewL a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ViewL a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ViewL a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ViewL a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ViewL a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ViewL a -> m (ViewL a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ViewL a -> m (ViewL a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ViewL a -> m (ViewL a) #

Generic (ViewL a) |
Instance details Defined in Data.Sequence.Internal Associated Types type Rep (ViewL a) :: Type -> Type Methods from :: ViewL a -> Rep (ViewL a) x to :: Rep (ViewL a) x -> ViewL a
Read a => Read (ViewL a) |
Instance details Defined in Data.Sequence.Internal Methods readsPrec :: Int -> ReadS (ViewL a) readList :: ReadS [ViewL a] readPrec :: ReadPrec (ViewL a) readListPrec :: ReadPrec [ViewL a]
Show a => Show (ViewL a) |
Instance details Defined in Data.Sequence.Internal Methods showsPrec :: Int -> ViewL a -> ShowS show :: ViewL a -> String # showList :: [ViewL a] -> ShowS
Eq a => Eq (ViewL a) |
Instance details Defined in Data.Sequence.Internal Methods (==) :: ViewL a -> ViewL a -> Bool # (/=) :: ViewL a -> ViewL a -> Bool #
Ord a => Ord (ViewL a) |
Instance details Defined in Data.Sequence.Internal Methods compare :: ViewL a -> ViewL a -> Ordering # (<) :: ViewL a -> ViewL a -> Bool # (<=) :: ViewL a -> ViewL a -> Bool # (>) :: ViewL a -> ViewL a -> Bool # (>=) :: ViewL a -> ViewL a -> Bool # max :: ViewL a -> ViewL a -> ViewL a # min :: ViewL a -> ViewL a -> ViewL a #
type Rep1 ViewL |

Instance details

Defined in Data.Sequence.Internal

type Rep1 ViewL = D1 ('MetaData "ViewL" "Data.Sequence.Internal" "containers-0.6.7" 'False) (C1 ('MetaCons "EmptyL" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons ":<" ('InfixI 'RightAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1 :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Seq)))

type Rep (ViewL a) |

Instance details

Defined in Data.Sequence.Internal

type Rep (ViewL a) = D1 ('MetaData "ViewL" "Data.Sequence.Internal" "containers-0.6.7" 'False) (C1 ('MetaCons "EmptyL" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons ":<" ('InfixI 'RightAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq a))))

viewl :: Seq a -> ViewL a #

data ViewR a #

Constructors

EmptyR |
(Seq a) :> a |

#### Instances

Instances details

Foldable ViewR |

Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => ViewR m -> m #

foldMap :: Monoid m => (a -> m) -> ViewR a -> m #

foldMap' :: Monoid m => (a -> m) -> ViewR a -> m

foldr :: (a -> b -> b) -> b -> ViewR a -> b #

foldr' :: (a -> b -> b) -> b -> ViewR a -> b

foldl :: (b -> a -> b) -> b -> ViewR a -> b #

foldl' :: (b -> a -> b) -> b -> ViewR a -> b #

foldr1 :: (a -> a -> a) -> ViewR a -> a #

foldl1 :: (a -> a -> a) -> ViewR a -> a #

toList :: ViewR a -> [a] #

null :: ViewR a -> Bool #

length :: ViewR a -> Int #

elem :: Eq a => a -> ViewR a -> Bool #

maximum :: Ord a => ViewR a -> a #

minimum :: Ord a => ViewR a -> a #

sum :: Num a => ViewR a -> a #

product :: Num a => ViewR a -> a #

Traversable ViewR |
Instance details Defined in Data.Sequence.Internal Methods traverse :: Applicative f => (a -> f b) -> ViewR a -> f (ViewR b) # sequenceA :: Applicative f => ViewR (f a) -> f (ViewR a) # mapM :: Monad m => (a -> m b) -> ViewR a -> m (ViewR b) # sequence :: Monad m => ViewR (m a) -> m (ViewR a) #
Functor ViewR |
Instance details Defined in Data.Sequence.Internal Methods fmap :: (a -> b) -> ViewR a -> ViewR b # (<$) :: a -> ViewR b -> ViewR a #
Generic1 ViewR |
Instance details Defined in Data.Sequence.Internal Associated Types type Rep1 ViewR :: k -> Type Methods from1 :: forall (a :: k). ViewR a -> Rep1 ViewR a to1 :: forall (a :: k). Rep1 ViewR a -> ViewR a
Lift a => Lift (ViewR a :: Type) |
Instance details Defined in Data.Sequence.Internal Methods lift :: Quote m => ViewR a -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => ViewR a -> Code m (ViewR a)
Data a => Data (ViewR a) |

Instance details

Defined in Data.Sequence.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ViewR a -> c (ViewR a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ViewR a) #

toConstr :: ViewR a -> Constr #

dataTypeOf :: ViewR a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ViewR a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ViewR a)) #

gmapT :: (forall b. Data b => b -> b) -> ViewR a -> ViewR a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ViewR a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ViewR a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ViewR a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ViewR a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ViewR a -> m (ViewR a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ViewR a -> m (ViewR a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ViewR a -> m (ViewR a) #

Generic (ViewR a) |
Instance details Defined in Data.Sequence.Internal Associated Types type Rep (ViewR a) :: Type -> Type Methods from :: ViewR a -> Rep (ViewR a) x to :: Rep (ViewR a) x -> ViewR a
Read a => Read (ViewR a) |
Instance details Defined in Data.Sequence.Internal Methods readsPrec :: Int -> ReadS (ViewR a) readList :: ReadS [ViewR a] readPrec :: ReadPrec (ViewR a) readListPrec :: ReadPrec [ViewR a]
Show a => Show (ViewR a) |
Instance details Defined in Data.Sequence.Internal Methods showsPrec :: Int -> ViewR a -> ShowS show :: ViewR a -> String # showList :: [ViewR a] -> ShowS
Eq a => Eq (ViewR a) |
Instance details Defined in Data.Sequence.Internal Methods (==) :: ViewR a -> ViewR a -> Bool # (/=) :: ViewR a -> ViewR a -> Bool #
Ord a => Ord (ViewR a) |
Instance details Defined in Data.Sequence.Internal Methods compare :: ViewR a -> ViewR a -> Ordering # (<) :: ViewR a -> ViewR a -> Bool # (<=) :: ViewR a -> ViewR a -> Bool # (>) :: ViewR a -> ViewR a -> Bool # (>=) :: ViewR a -> ViewR a -> Bool # max :: ViewR a -> ViewR a -> ViewR a # min :: ViewR a -> ViewR a -> ViewR a #
type Rep1 ViewR |

Instance details

Defined in Data.Sequence.Internal

type Rep1 ViewR = D1 ('MetaData "ViewR" "Data.Sequence.Internal" "containers-0.6.7" 'False) (C1 ('MetaCons "EmptyR" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons ":>" ('InfixI 'LeftAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Seq) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))

type Rep (ViewR a) |

Instance details

Defined in Data.Sequence.Internal

type Rep (ViewR a) = D1 ('MetaData "ViewR" "Data.Sequence.Internal" "containers-0.6.7" 'False) (C1 ('MetaCons "EmptyR" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons ":>" ('InfixI 'LeftAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

viewr :: Seq a -> ViewR a #

# Scans

scanl :: (a -> b -> a) -> a -> Seq b -> Seq a #

scanl1 :: (a -> a -> a) -> Seq a -> Seq a #

scanr :: (a -> b -> b) -> b -> Seq a -> Seq b #

scanr1 :: (a -> a -> a) -> Seq a -> Seq a #

# Sublists

tails :: Seq a -> Seq (Seq a) #

inits :: Seq a -> Seq (Seq a) #

chunksOf :: Int -> Seq a -> Seq (Seq a) #

## Sequential searches

takeWhileL :: (a -> Bool) -> Seq a -> Seq a #

takeWhileR :: (a -> Bool) -> Seq a -> Seq a #

dropWhileL :: (a -> Bool) -> Seq a -> Seq a #

dropWhileR :: (a -> Bool) -> Seq a -> Seq a #

spanl :: (a -> Bool) -> Seq a -> (Seq a, Seq a) #

spanr :: (a -> Bool) -> Seq a -> (Seq a, Seq a) #

breakl :: (a -> Bool) -> Seq a -> (Seq a, Seq a) #

breakr :: (a -> Bool) -> Seq a -> (Seq a, Seq a) #

partition :: (a -> Bool) -> Seq a -> (Seq a, Seq a) #

filter :: (a -> Bool) -> Seq a -> Seq a #

# Sorting

sort :: Ord a => Seq a -> Seq a #

sortBy :: (a -> a -> Ordering) -> Seq a -> Seq a #

unstableSort :: Ord a => Seq a -> Seq a #

unstableSortBy :: (a -> a -> Ordering) -> Seq a -> Seq a #

# Indexing

lookup :: Int -> Seq a -> Maybe a #

(!?) :: Seq a -> Int -> Maybe a #

index :: Seq a -> Int -> a #

adjust :: (a -> a) -> Int -> Seq a -> Seq a #

adjust' :: (a -> a) -> Int -> Seq a -> Seq a #

update :: Int -> a -> Seq a -> Seq a #

take :: Int -> Seq a -> Seq a #

drop :: Int -> Seq a -> Seq a #

insertAt :: Int -> a -> Seq a -> Seq a #

deleteAt :: Int -> Seq a -> Seq a #

splitAt :: Int -> Seq a -> (Seq a, Seq a) #

## Indexing with predicates

These functions perform sequential searches from the left or right ends of the sequence elements.

elemIndexL :: Eq a => a -> Seq a -> Maybe Int #

elemIndicesL :: Eq a => a -> Seq a -> [Int] #

elemIndexR :: Eq a => a -> Seq a -> Maybe Int #

elemIndicesR :: Eq a => a -> Seq a -> [Int] #

findIndexL :: (a -> Bool) -> Seq a -> Maybe Int #

findIndicesL :: (a -> Bool) -> Seq a -> [Int] #

findIndexR :: (a -> Bool) -> Seq a -> Maybe Int #

findIndicesR :: (a -> Bool) -> Seq a -> [Int] #

# Folds

General folds are available via the `Foldable` instance of `Seq`.

foldMapWithIndex :: Monoid m => (Int -> a -> m) -> Seq a -> m #

foldlWithIndex :: (b -> Int -> a -> b) -> b -> Seq a -> b #

foldrWithIndex :: (Int -> a -> b -> b) -> b -> Seq a -> b #

# Transformations

mapWithIndex :: (Int -> a -> b) -> Seq a -> Seq b #

traverseWithIndex :: Applicative f => (Int -> a -> f b) -> Seq a -> f (Seq b) #

reverse :: Seq a -> Seq a #

intersperse :: a -> Seq a -> Seq a #

## Zips

zip :: Seq a -> Seq b -> Seq (a, b) #

zipWith :: (a -> b -> c) -> Seq a -> Seq b -> Seq c #

zip3 :: Seq a -> Seq b -> Seq c -> Seq (a, b, c) #

zipWith3 :: (a -> b -> c -> d) -> Seq a -> Seq b -> Seq c -> Seq d #

zip4 :: Seq a -> Seq b -> Seq c -> Seq d -> Seq (a, b, c, d) #

zipWith4 :: (a -> b -> c -> d -> e) -> Seq a -> Seq b -> Seq c -> Seq d -> Seq e #