bricks-internal-0.0.0.4: ...

Safe HaskellSafe
LanguageHaskell2010

Bricks.Internal.Seq

Synopsis

Documentation

data Seq a :: * -> * #

General-purpose finite sequences.

Instances

Monad Seq 

Methods

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

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

return :: a -> Seq a #

fail :: String -> Seq a #

Functor Seq 

Methods

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

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

Applicative Seq 

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 #

Foldable Seq 

Methods

fold :: Monoid m => Seq m -> 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 #

Traversable Seq 

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) #

Eq1 Seq 

Methods

liftEq :: (a -> b -> Bool) -> Seq a -> Seq b -> Bool #

Ord1 Seq 

Methods

liftCompare :: (a -> b -> Ordering) -> Seq a -> Seq b -> Ordering #

Read1 Seq 

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 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Seq a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Seq a] -> ShowS #

MonadZip Seq 

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) #

Alternative Seq 

Methods

empty :: Seq a #

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

some :: Seq a -> Seq [a] #

many :: Seq a -> Seq [a] #

MonadPlus Seq 

Methods

mzero :: Seq a #

mplus :: Seq a -> Seq a -> Seq a #

UnzipWith Seq 

Methods

unzipWith :: (x -> (a, b)) -> Seq x -> (Seq a, Seq b)

IsList (Seq a) 

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)] #

Eq a => Eq (Seq a) 

Methods

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

(/=) :: Seq a -> Seq a -> Bool #

Data a => Data (Seq a) 

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 :: (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) #

Ord a => Ord (Seq a) 

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 #

Read a => Read (Seq a) 
Show a => Show (Seq a) 

Methods

showsPrec :: Int -> Seq a -> ShowS #

show :: Seq a -> String #

showList :: [Seq a] -> ShowS #

IsString (Seq Char) 

Methods

fromString :: String -> Seq Char #

Semigroup (Seq a) 

Methods

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

sconcat :: NonEmpty (Seq a) -> Seq a #

stimes :: Integral b => b -> Seq a -> Seq a #

Monoid (Seq a) 

Methods

mempty :: Seq a #

mappend :: Seq a -> Seq a -> Seq a #

mconcat :: [Seq a] -> Seq a #

NFData a => NFData (Seq a) 

Methods

rnf :: Seq a -> () #

type Item (Seq a) 
type Item (Seq a) = a

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

O(1). Add an element to the left end of a sequence. Mnemonic: a triangle with the single element at the pointy end.

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

O(1). Add an element to the right end of a sequence. Mnemonic: a triangle with the single element at the pointy end.

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

O(log(min(i,n-i))). Update the element at the specified position. If the position is out of range, the original sequence is returned. adjust can lead to poor performance and even memory leaks, because it does not force the new value before installing it in the sequence. adjust' should usually be preferred.

adjustLast :: (a -> a) -> Seq a -> Seq a Source #

>>> adjustLast (+ 1) (fromList [1, 2, 3])
fromList [1,2,4]
>>> adjustLast (+ 1) empty
fromList []

append :: Seq a -> Seq a -> Seq a Source #

Alias for ><.

concat :: Foldable f => f (Seq a) -> Seq a Source #

fold specialized for Seq.

concatMap :: Foldable f => (a -> Seq b) -> f a -> Seq b Source #

Like concatMap, but for Seq.

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

O(i) where i is the prefix length. dropWhileL p xs returns the suffix remaining after takeWhileL p xs.

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

O(i) where i is the suffix length. dropWhileR p xs returns the prefix remaining after takeWhileR p xs.

dropWhileR p xs is equivalent to reverse (dropWhileL p (reverse xs)).

empty :: Seq a #

O(1). The empty sequence.

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

O(n). The filter function takes a predicate p and a sequence xs and returns a sequence of those elements which satisfy the predicate.

fromList :: [a] -> Seq a #

O(n). Create a sequence from a finite list of elements. There is a function toList in the opposite direction for all instances of the Foldable class, including Seq.

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

Like intersperse, but for Seq.

length :: Seq a -> Int #

O(1). The number of elements in the sequence.

map :: (a -> b) -> Seq a -> Seq b Source #

Specialization of fmap.

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

>>> minimum (fromList [1,2,3])
Just 1
>>> minimum empty
Nothing

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

>>> maximum (fromList [1,2,3])
Just 3
>>> maximum empty
Nothing

null :: Seq a -> Bool #

O(1). Is this the empty sequence?

toList :: Seq a -> [a] Source #

Specialization of toList for Seq.

trimWhile :: (a -> Bool) -> Seq a -> Seq a Source #

singleton :: a -> Seq a #

O(1). A singleton sequence.