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

Data.Monoid.Instances.Measured

Description

This module defines the monoid transformer data type Measured.

Synopsis

Documentation

data Measured a Source #

Measured a is a wrapper around the FactorialMonoid a that memoizes the monoid's length so it becomes a constant-time operation. The parameter is restricted to the StableFactorial class, which guarantees that length (a <> b) == length a + length b.

Instances

Instances details
Data a => Data (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

Methods

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

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

toConstr :: Measured a -> Constr #

dataTypeOf :: Measured a -> DataType #

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

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

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

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

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

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

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

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

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

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

(FactorialMonoid a, IsString a) => IsString (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

Methods

fromString :: String -> Measured a #

(StableFactorial a, Monoid a) => Monoid (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

Methods

mempty :: Measured a #

mappend :: Measured a -> Measured a -> Measured a #

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

StableFactorial a => Semigroup (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

Methods

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

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

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

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

Defined in Data.Monoid.Instances.Measured

Methods

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

show :: Measured a -> String #

showList :: [Measured a] -> ShowS #

Eq a => Eq (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

Methods

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

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

Ord a => Ord (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

Methods

compare :: Measured a -> Measured a -> Ordering #

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

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

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

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

max :: Measured a -> Measured a -> Measured a #

min :: Measured a -> Measured a -> Measured a #

(StableFactorial a, FactorialMonoid a) => FactorialMonoid (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

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

Defined in Data.Monoid.Instances.Measured

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

Defined in Data.Monoid.Instances.Measured

(StableFactorial a, Monoid a) => MonoidNull (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

Methods

null :: Measured a -> Bool Source #

(StableFactorial a, Monoid a) => PositiveMonoid (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

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

Defined in Data.Monoid.Instances.Measured

Methods

fromText :: Text -> Measured a Source #

singleton :: Char -> Measured a Source #

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

characterPrefix :: Measured a -> Maybe Char Source #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Defined in Data.Monoid.Instances.Measured

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

Defined in Data.Monoid.Instances.Measured

(StableFactorial a, MonoidNull a) => Factorial (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

Methods

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

primePrefix :: Measured a -> Measured a Source #

primeSuffix :: Measured a -> Measured a Source #

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

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

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

length :: Measured a -> Int Source #

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

reverse :: Measured a -> Measured a Source #

(StableFactorial a, MonoidNull a) => StableFactorial (Measured a) Source # 
Instance details

Defined in Data.Monoid.Instances.Measured

measure :: Factorial a => a -> Measured a Source #

Create a new Measured value.