monoid-subclasses-0.4.4: Subclasses of Monoid

Safe HaskellSafe
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

Functor Concat Source # 

Methods

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

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

Applicative Concat Source # 

Methods

pure :: a -> Concat a #

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

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

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

Foldable Concat Source # 

Methods

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

(Eq a, Monoid a) => Eq (Concat a) Source # 

Methods

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

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

(Ord a, Monoid a) => Ord (Concat a) Source # 

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 #

Show a => Show (Concat a) Source # 

Methods

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

show :: Concat a -> String #

showList :: [Concat a] -> ShowS #

IsString a => IsString (Concat a) Source # 

Methods

fromString :: String -> Concat a #

PositiveMonoid a => Monoid (Concat a) Source # 

Methods

mempty :: Concat a #

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

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

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

Methods

null :: Concat a -> Bool Source #

(FactorialMonoid a, PositiveMonoid a) => StableFactorialMonoid (Concat a) Source # 
(FactorialMonoid a, PositiveMonoid a) => FactorialMonoid (Concat a) Source # 

Methods

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

primePrefix :: Concat a -> Concat a Source #

primeSuffix :: Concat a -> Concat a Source #

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 #

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

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

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

length :: Concat a -> Int Source #

foldMap :: Monoid n => (Concat a -> n) -> Concat a -> n 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 #

reverse :: Concat a -> Concat a Source #

(RightGCDMonoid a, StableFactorialMonoid a) => RightGCDMonoid (Concat a) Source # 
(LeftGCDMonoid a, StableFactorialMonoid a) => LeftGCDMonoid (Concat a) Source # 
(RightReductiveMonoid a, StableFactorialMonoid a) => RightReductiveMonoid (Concat a) Source # 
(LeftReductiveMonoid a, StableFactorialMonoid a) => LeftReductiveMonoid (Concat a) Source # 
(Eq a, TextualMonoid a, StableFactorialMonoid a) => TextualMonoid (Concat a) Source # 

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 #

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

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

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

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

foldr :: (Concat a -> a -> a) -> (Char -> a -> a) -> a -> Concat a -> a 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 :: (a -> Char -> (a, Char)) -> a -> Concat a -> (a, Concat a) Source #

mapAccumR :: (a -> Char -> (a, Char)) -> a -> Concat a -> (a, 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_ :: (a -> Char -> a) -> a -> Concat a -> a Source #

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

foldr_ :: (Char -> a -> a) -> a -> Concat a -> a 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 #

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 :: Monoid a => Concat a -> a Source #