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

Data.Monoid.Instances.PrefixMemory

Description

This module defines the monoid transformer data type Shadowed.

Synopsis

Documentation

data Shadowed m Source #

Monoid transformer that keeps track of the former prefix of its content. All functions that return a suffix of their argument, such as stripPrefix or commonSuffix, preserve the discarded prefix.

Instances

Instances details
Data m => Data (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Shadowed m -> c (Shadowed m) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Shadowed m) #

toConstr :: Shadowed m -> Constr #

dataTypeOf :: Shadowed m -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> Shadowed m -> Shadowed m #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Shadowed m -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Shadowed m -> r #

gmapQ :: (forall d. Data d => d -> u) -> Shadowed m -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Shadowed m -> u #

gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> Shadowed m -> m0 (Shadowed m) #

gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> Shadowed m -> m0 (Shadowed m) #

gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> Shadowed m -> m0 (Shadowed m) #

(Monoid m, IsString m) => IsString (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

fromString :: String -> Shadowed m #

(MonoidNull m, StableFactorial m) => Monoid (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

mempty :: Shadowed m #

mappend :: Shadowed m -> Shadowed m -> Shadowed m #

mconcat :: [Shadowed m] -> Shadowed m #

(MonoidNull m, StableFactorial m) => Semigroup (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

(<>) :: Shadowed m -> Shadowed m -> Shadowed m #

sconcat :: NonEmpty (Shadowed m) -> Shadowed m #

stimes :: Integral b => b -> Shadowed m -> Shadowed m #

(MonoidNull m, Show m) => Show (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

showsPrec :: Int -> Shadowed m -> ShowS #

show :: Shadowed m -> String #

showList :: [Shadowed m] -> ShowS #

Eq m => Eq (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

(==) :: Shadowed m -> Shadowed m -> Bool #

(/=) :: Shadowed m -> Shadowed m -> Bool #

Ord m => Ord (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

compare :: Shadowed m -> Shadowed m -> Ordering #

(<) :: Shadowed m -> Shadowed m -> Bool #

(<=) :: Shadowed m -> Shadowed m -> Bool #

(>) :: Shadowed m -> Shadowed m -> Bool #

(>=) :: Shadowed m -> Shadowed m -> Bool #

max :: Shadowed m -> Shadowed m -> Shadowed m #

min :: Shadowed m -> Shadowed m -> Shadowed m #

(StableFactorial m, FactorialMonoid m) => FactorialMonoid (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

(Eq m, StableFactorial m, FactorialMonoid m, LeftGCDMonoid m) => LeftGCDMonoid (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

(StableFactorial m, FactorialMonoid m, RightGCDMonoid m) => RightGCDMonoid (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

(MonoidNull m, StableFactorial m) => MonoidNull (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

null :: Shadowed m -> Bool Source #

(PositiveMonoid m, StableFactorial m) => PositiveMonoid (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

(Eq m, StableFactorial m, TextualMonoid m) => TextualMonoid (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

fromText :: Text -> Shadowed m Source #

singleton :: Char -> Shadowed m Source #

splitCharacterPrefix :: Shadowed m -> Maybe (Char, Shadowed m) Source #

characterPrefix :: Shadowed m -> Maybe Char Source #

map :: (Char -> Char) -> Shadowed m -> Shadowed m Source #

concatMap :: (Char -> Shadowed m) -> Shadowed m -> Shadowed m Source #

toString :: (Shadowed m -> String) -> Shadowed m -> String Source #

toText :: (Shadowed m -> Text) -> Shadowed m -> Text Source #

any :: (Char -> Bool) -> Shadowed m -> Bool Source #

all :: (Char -> Bool) -> Shadowed m -> Bool Source #

foldl :: (a -> Shadowed m -> a) -> (a -> Char -> a) -> a -> Shadowed m -> a Source #

foldl' :: (a -> Shadowed m -> a) -> (a -> Char -> a) -> a -> Shadowed m -> a Source #

foldr :: (Shadowed m -> a -> a) -> (Char -> a -> a) -> a -> Shadowed m -> a Source #

scanl :: (Char -> Char -> Char) -> Char -> Shadowed m -> Shadowed m Source #

scanl1 :: (Char -> Char -> Char) -> Shadowed m -> Shadowed m Source #

scanr :: (Char -> Char -> Char) -> Char -> Shadowed m -> Shadowed m Source #

scanr1 :: (Char -> Char -> Char) -> Shadowed m -> Shadowed m Source #

mapAccumL :: (a -> Char -> (a, Char)) -> a -> Shadowed m -> (a, Shadowed m) Source #

mapAccumR :: (a -> Char -> (a, Char)) -> a -> Shadowed m -> (a, Shadowed m) Source #

takeWhile :: (Shadowed m -> Bool) -> (Char -> Bool) -> Shadowed m -> Shadowed m Source #

dropWhile :: (Shadowed m -> Bool) -> (Char -> Bool) -> Shadowed m -> Shadowed m Source #

break :: (Shadowed m -> Bool) -> (Char -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) Source #

span :: (Shadowed m -> Bool) -> (Char -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) Source #

spanMaybe :: s -> (s -> Shadowed m -> Maybe s) -> (s -> Char -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) Source #

spanMaybe' :: s -> (s -> Shadowed m -> Maybe s) -> (s -> Char -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) Source #

split :: (Char -> Bool) -> Shadowed m -> [Shadowed m] Source #

find :: (Char -> Bool) -> Shadowed m -> Maybe Char Source #

elem :: Char -> Shadowed m -> Bool Source #

foldl_ :: (a -> Char -> a) -> a -> Shadowed m -> a Source #

foldl_' :: (a -> Char -> a) -> a -> Shadowed m -> a Source #

foldr_ :: (Char -> a -> a) -> a -> Shadowed m -> a Source #

takeWhile_ :: Bool -> (Char -> Bool) -> Shadowed m -> Shadowed m Source #

dropWhile_ :: Bool -> (Char -> Bool) -> Shadowed m -> Shadowed m Source #

break_ :: Bool -> (Char -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) Source #

span_ :: Bool -> (Char -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) Source #

spanMaybe_ :: s -> (s -> Char -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) Source #

spanMaybe_' :: s -> (s -> Char -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) Source #

(MonoidNull m, StableFactorial m, LeftReductive m) => LeftReductive (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

(StableFactorial m, FactorialMonoid m, RightReductive m) => RightReductive (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

(FactorialMonoid m, StableFactorial m) => Factorial (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

Methods

factors :: Shadowed m -> [Shadowed m] Source #

primePrefix :: Shadowed m -> Shadowed m Source #

primeSuffix :: Shadowed m -> Shadowed m Source #

foldl :: (a -> Shadowed m -> a) -> a -> Shadowed m -> a Source #

foldl' :: (a -> Shadowed m -> a) -> a -> Shadowed m -> a Source #

foldr :: (Shadowed m -> a -> a) -> a -> Shadowed m -> a Source #

length :: Shadowed m -> Int Source #

foldMap :: Monoid n => (Shadowed m -> n) -> Shadowed m -> n Source #

reverse :: Shadowed m -> Shadowed m Source #

(StableFactorial m, FactorialMonoid m) => StableFactorial (Shadowed m) Source # 
Instance details

Defined in Data.Monoid.Instances.PrefixMemory

shadowed :: Monoid m => m -> Shadowed m Source #

The constructor of a Shadowed monoid, with the initial prefix = null

content :: Shadowed m -> m Source #

the present value

prefix :: Shadowed m -> m Source #

used to precede the content but has been consumed