Data.Monoid.Instances.PrefixMemory

monoid-subclasses-1.2.5.1: Subclasses of Monoid

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Monoid.Instances.PrefixMemory

Description

This module defines the monoid transformer data type `Shadowed`.

Synopsis

- data Shadowed m
- shadowed :: Monoid m => m -> Shadowed m
- content :: Shadowed m -> m
- prefix :: Shadowed m -> m

# Documentation

data Shadowed m #

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

(MonoidNull m, StableFactorial m) => Monoid (Shadowed m) # |
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) # |
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 #
Data m => Data (Shadowed m) # |
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) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods fromString :: String -> Shadowed m #
(MonoidNull m, Show m) => Show (Shadowed m) # |
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) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods (==) :: Shadowed m -> Shadowed m -> Bool # (/=) :: Shadowed m -> Shadowed m -> Bool #
Ord m => Ord (Shadowed m) # |
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) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods splitPrimePrefix :: Shadowed m -> Maybe (Shadowed m, Shadowed m) # splitPrimeSuffix :: Shadowed m -> Maybe (Shadowed m, Shadowed m) # inits :: Shadowed m -> [Shadowed m] # tails :: Shadowed m -> [Shadowed m] # span :: (Shadowed m -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) # break :: (Shadowed m -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) # split :: (Shadowed m -> Bool) -> Shadowed m -> [Shadowed m] # takeWhile :: (Shadowed m -> Bool) -> Shadowed m -> Shadowed m # dropWhile :: (Shadowed m -> Bool) -> Shadowed m -> Shadowed m # spanMaybe :: s -> (s -> Shadowed m -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) # spanMaybe' :: s -> (s -> Shadowed m -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) # splitAt :: Int -> Shadowed m -> (Shadowed m, Shadowed m) # drop :: Int -> Shadowed m -> Shadowed m # take :: Int -> Shadowed m -> Shadowed m #
(Eq m, StableFactorial m, FactorialMonoid m, LeftGCDMonoid m) => LeftGCDMonoid (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods commonPrefix :: Shadowed m -> Shadowed m -> Shadowed m # stripCommonPrefix :: Shadowed m -> Shadowed m -> (Shadowed m, Shadowed m, Shadowed m) #
(StableFactorial m, FactorialMonoid m, RightGCDMonoid m) => RightGCDMonoid (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods commonSuffix :: Shadowed m -> Shadowed m -> Shadowed m # stripCommonSuffix :: Shadowed m -> Shadowed m -> (Shadowed m, Shadowed m, Shadowed m) #
(MonoidNull m, StableFactorial m) => MonoidNull (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods null :: Shadowed m -> Bool #
(PositiveMonoid m, StableFactorial m) => PositiveMonoid (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory
(Eq m, StableFactorial m, TextualMonoid m) => TextualMonoid (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods fromText :: Text -> Shadowed m # singleton :: Char -> Shadowed m # splitCharacterPrefix :: Shadowed m -> Maybe (Char, Shadowed m) # characterPrefix :: Shadowed m -> Maybe Char # map :: (Char -> Char) -> Shadowed m -> Shadowed m # concatMap :: (Char -> Shadowed m) -> Shadowed m -> Shadowed m # toString :: (Shadowed m -> String) -> Shadowed m -> String # toText :: (Shadowed m -> Text) -> Shadowed m -> Text # any :: (Char -> Bool) -> Shadowed m -> Bool # all :: (Char -> Bool) -> Shadowed m -> Bool # foldl :: (a -> Shadowed m -> a) -> (a -> Char -> a) -> a -> Shadowed m -> a # foldl' :: (a -> Shadowed m -> a) -> (a -> Char -> a) -> a -> Shadowed m -> a # foldr :: (Shadowed m -> a -> a) -> (Char -> a -> a) -> a -> Shadowed m -> a # scanl :: (Char -> Char -> Char) -> Char -> Shadowed m -> Shadowed m # scanl1 :: (Char -> Char -> Char) -> Shadowed m -> Shadowed m # scanr :: (Char -> Char -> Char) -> Char -> Shadowed m -> Shadowed m # scanr1 :: (Char -> Char -> Char) -> Shadowed m -> Shadowed m # mapAccumL :: (a -> Char -> (a, Char)) -> a -> Shadowed m -> (a, Shadowed m) # mapAccumR :: (a -> Char -> (a, Char)) -> a -> Shadowed m -> (a, Shadowed m) # takeWhile :: (Shadowed m -> Bool) -> (Char -> Bool) -> Shadowed m -> Shadowed m # dropWhile :: (Shadowed m -> Bool) -> (Char -> Bool) -> Shadowed m -> Shadowed m # break :: (Shadowed m -> Bool) -> (Char -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) # span :: (Shadowed m -> Bool) -> (Char -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) # spanMaybe :: s -> (s -> Shadowed m -> Maybe s) -> (s -> Char -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) # spanMaybe' :: s -> (s -> Shadowed m -> Maybe s) -> (s -> Char -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) # split :: (Char -> Bool) -> Shadowed m -> [Shadowed m] # find :: (Char -> Bool) -> Shadowed m -> Maybe Char # elem :: Char -> Shadowed m -> Bool # foldl_ :: (a -> Char -> a) -> a -> Shadowed m -> a # foldl_' :: (a -> Char -> a) -> a -> Shadowed m -> a # foldr_ :: (Char -> a -> a) -> a -> Shadowed m -> a # takeWhile_ :: Bool -> (Char -> Bool) -> Shadowed m -> Shadowed m # dropWhile_ :: Bool -> (Char -> Bool) -> Shadowed m -> Shadowed m # break_ :: Bool -> (Char -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) # span_ :: Bool -> (Char -> Bool) -> Shadowed m -> (Shadowed m, Shadowed m) # spanMaybe_ :: s -> (s -> Char -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) # spanMaybe_' :: s -> (s -> Char -> Maybe s) -> Shadowed m -> (Shadowed m, Shadowed m, s) #
(MonoidNull m, StableFactorial m, LeftReductive m) => LeftReductive (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods isPrefixOf :: Shadowed m -> Shadowed m -> Bool # stripPrefix :: Shadowed m -> Shadowed m -> Maybe (Shadowed m) #
(StableFactorial m, FactorialMonoid m, RightReductive m) => RightReductive (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods isSuffixOf :: Shadowed m -> Shadowed m -> Bool # stripSuffix :: Shadowed m -> Shadowed m -> Maybe (Shadowed m) #
(FactorialMonoid m, StableFactorial m) => Factorial (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods factors :: Shadowed m -> [Shadowed m] # primePrefix :: Shadowed m -> Shadowed m # primeSuffix :: Shadowed m -> Shadowed m # foldl :: (a -> Shadowed m -> a) -> a -> Shadowed m -> a # foldl' :: (a -> Shadowed m -> a) -> a -> Shadowed m -> a # foldr :: (Shadowed m -> a -> a) -> a -> Shadowed m -> a # length :: Shadowed m -> Int # foldMap :: Monoid n => (Shadowed m -> n) -> Shadowed m -> n # reverse :: Shadowed m -> Shadowed m #
(StableFactorial m, FactorialMonoid m) => StableFactorial (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory

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

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

content :: Shadowed m -> m #

the present value

prefix :: Shadowed m -> m #

used to precede the `content` but has been consumed