monoid-subclasses-1.2.5.1: Subclasses of Monoid
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Monoid.Instances.Concat

Description

This module defines the monoid transformer data type Concat.

Synopsis

Documentation

data Concat a Source #

Concat is a transparent monoid transformer. The behaviour of the Concat a instances of monoid subclasses is identical to the behaviour of their a instances, up to the pure isomorphism.

The only purpose of Concat then is to change the performance characteristics of various operations. Most importantly, injecting a monoid into Concat has the effect of making mappend a constant-time operation. The splitPrimePrefix and splitPrimeSuffix operations are amortized to constant time, provided that only one or the other is used. Using both operations alternately will trigger the worst-case behaviour of O(n).

Instances

Instances details
Foldable Concat Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

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

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

foldMap' :: Monoid m => (a -> m) -> Concat a -> m #

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

foldr' :: (a -> b -> b) -> b -> Concat a -> b #

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

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

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

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

toList :: Concat a -> [a] #

null :: Concat a -> Bool #

length :: Concat a -> Int #

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

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

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

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

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

Applicative Concat Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

pure :: a -> Concat a #

(<*>) :: Concat (a -> b) -> Concat a -> Concat b #

liftA2 :: (a -> b -> c) -> Concat a -> Concat b -> Concat c #

(*>) :: Concat a -> Concat b -> Concat b #

(<*) :: Concat a -> Concat b -> Concat a #

Functor Concat Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

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

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

Data a => Data (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

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

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

toConstr :: Concat a -> Constr #

dataTypeOf :: Concat a -> DataType #

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

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

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

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

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

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

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

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

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

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

IsString a => IsString (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

fromString :: String -> Concat a #

PositiveMonoid a => Monoid (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

mempty :: Concat a #

mappend :: Concat a -> Concat a -> Concat a #

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

PositiveMonoid a => Semigroup (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

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

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

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

Show a => Show (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

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

show :: Concat a -> String #

showList :: [Concat a] -> ShowS #

(Eq a, Semigroup a) => Eq (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

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

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

(Ord a, Semigroup a) => Ord (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

compare :: Concat a -> Concat a -> Ordering #

(<) :: Concat a -> Concat a -> Bool #

(<=) :: Concat a -> Concat a -> Bool #

(>) :: Concat a -> Concat a -> Bool #

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

max :: Concat a -> Concat a -> Concat a #

min :: Concat a -> Concat a -> Concat a #

(FactorialMonoid a, PositiveMonoid a) => FactorialMonoid (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

splitPrimePrefix :: Concat a -> Maybe (Concat a, Concat a) Source #

splitPrimeSuffix :: Concat a -> Maybe (Concat a, Concat a) Source #

inits :: Concat a -> [Concat a] Source #

tails :: Concat a -> [Concat a] Source #

span :: (Concat a -> Bool) -> Concat a -> (Concat a, Concat a) Source #

break :: (Concat a -> Bool) -> Concat a -> (Concat a, Concat a) Source #

split :: (Concat a -> Bool) -> Concat a -> [Concat a] Source #

takeWhile :: (Concat a -> Bool) -> Concat a -> Concat a Source #

dropWhile :: (Concat a -> Bool) -> Concat a -> Concat a Source #

spanMaybe :: s -> (s -> Concat a -> Maybe s) -> Concat a -> (Concat a, Concat a, s) Source #

spanMaybe' :: s -> (s -> Concat a -> Maybe s) -> Concat a -> (Concat a, Concat a, s) Source #

splitAt :: Int -> Concat a -> (Concat a, Concat a) Source #

drop :: Int -> Concat a -> Concat a Source #

take :: Int -> Concat a -> Concat a Source #

(LeftGCDMonoid a, StableFactorial a, PositiveMonoid a) => LeftGCDMonoid (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

(RightGCDMonoid a, StableFactorial a, PositiveMonoid a) => RightGCDMonoid (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

PositiveMonoid a => MonoidNull (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

null :: Concat a -> Bool Source #

PositiveMonoid a => PositiveMonoid (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

(Eq a, TextualMonoid a, StableFactorial a, PositiveMonoid a) => TextualMonoid (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

fromText :: Text -> Concat a Source #

singleton :: Char -> Concat a Source #

splitCharacterPrefix :: Concat a -> Maybe (Char, Concat a) Source #

characterPrefix :: Concat a -> Maybe Char Source #

map :: (Char -> Char) -> Concat a -> Concat a Source #

concatMap :: (Char -> Concat a) -> Concat a -> Concat a Source #

toString :: (Concat a -> String) -> Concat a -> String Source #

toText :: (Concat a -> Text) -> Concat a -> Text Source #

any :: (Char -> Bool) -> Concat a -> Bool Source #

all :: (Char -> Bool) -> Concat a -> Bool Source #

foldl :: (a0 -> Concat a -> a0) -> (a0 -> Char -> a0) -> a0 -> Concat a -> a0 Source #

foldl' :: (a0 -> Concat a -> a0) -> (a0 -> Char -> a0) -> a0 -> Concat a -> a0 Source #

foldr :: (Concat a -> a0 -> a0) -> (Char -> a0 -> a0) -> a0 -> Concat a -> a0 Source #

scanl :: (Char -> Char -> Char) -> Char -> Concat a -> Concat a Source #

scanl1 :: (Char -> Char -> Char) -> Concat a -> Concat a Source #

scanr :: (Char -> Char -> Char) -> Char -> Concat a -> Concat a Source #

scanr1 :: (Char -> Char -> Char) -> Concat a -> Concat a Source #

mapAccumL :: (a0 -> Char -> (a0, Char)) -> a0 -> Concat a -> (a0, Concat a) Source #

mapAccumR :: (a0 -> Char -> (a0, Char)) -> a0 -> Concat a -> (a0, Concat a) Source #

takeWhile :: (Concat a -> Bool) -> (Char -> Bool) -> Concat a -> Concat a Source #

dropWhile :: (Concat a -> Bool) -> (Char -> Bool) -> Concat a -> Concat a Source #

break :: (Concat a -> Bool) -> (Char -> Bool) -> Concat a -> (Concat a, Concat a) Source #

span :: (Concat a -> Bool) -> (Char -> Bool) -> Concat a -> (Concat a, Concat a) Source #

spanMaybe :: s -> (s -> Concat a -> Maybe s) -> (s -> Char -> Maybe s) -> Concat a -> (Concat a, Concat a, s) Source #

spanMaybe' :: s -> (s -> Concat a -> Maybe s) -> (s -> Char -> Maybe s) -> Concat a -> (Concat a, Concat a, s) Source #

split :: (Char -> Bool) -> Concat a -> [Concat a] Source #

find :: (Char -> Bool) -> Concat a -> Maybe Char Source #

elem :: Char -> Concat a -> Bool Source #

foldl_ :: (a0 -> Char -> a0) -> a0 -> Concat a -> a0 Source #

foldl_' :: (a0 -> Char -> a0) -> a0 -> Concat a -> a0 Source #

foldr_ :: (Char -> a0 -> a0) -> a0 -> Concat a -> a0 Source #

takeWhile_ :: Bool -> (Char -> Bool) -> Concat a -> Concat a Source #

dropWhile_ :: Bool -> (Char -> Bool) -> Concat a -> Concat a Source #

break_ :: Bool -> (Char -> Bool) -> Concat a -> (Concat a, Concat a) Source #

span_ :: Bool -> (Char -> Bool) -> Concat a -> (Concat a, Concat a) Source #

spanMaybe_ :: s -> (s -> Char -> Maybe s) -> Concat a -> (Concat a, Concat a, s) Source #

spanMaybe_' :: s -> (s -> Char -> Maybe s) -> Concat a -> (Concat a, Concat a, s) Source #

(LeftReductive a, StableFactorial a, PositiveMonoid a) => LeftReductive (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

(RightReductive a, StableFactorial a, PositiveMonoid a) => RightReductive (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

(Factorial a, PositiveMonoid a) => Factorial (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

Methods

factors :: Concat a -> [Concat a] Source #

primePrefix :: Concat a -> Concat a Source #

primeSuffix :: Concat a -> Concat a Source #

foldl :: (a0 -> Concat a -> a0) -> a0 -> Concat a -> a0 Source #

foldl' :: (a0 -> Concat a -> a0) -> a0 -> Concat a -> a0 Source #

foldr :: (Concat a -> a0 -> a0) -> a0 -> Concat a -> a0 Source #

length :: Concat a -> Int Source #

foldMap :: Monoid n => (Concat a -> n) -> Concat a -> n Source #

reverse :: Concat a -> Concat a Source #

(Factorial a, PositiveMonoid a) => StableFactorial (Concat a) Source # 
Instance details

Defined in Data.Monoid.Instances.Concat

concatenate :: PositiveMonoid a => Seq a -> Concat a Source #

Deprecated: Concat is not wrapping Seq any more, don't use concatenate nor extract.

extract :: Concat a -> Seq a Source #

Deprecated: Concat is not wrapping Seq any more, don't use concatenate nor extract.

force :: Semigroup a => Concat a -> a Source #