Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines the monoid transformer data type Measured
.
- data Measured a
- inject :: FactorialMonoid a => a -> Measured a
- measure :: FactorialMonoid a => a -> Measured a
- extract :: Measured a -> a
Documentation
is a wrapper around the Measured
aFactorialMonoid
a
that memoizes the monoid's length
so it becomes a
constant-time operation. The parameter is restricted to the StableFactorialMonoid
class, which guarantees that
.length
(a <> b) == length
a + length
b
Eq a => Eq (Measured a) | |
Ord a => Ord (Measured a) | |
Show a => Show (Measured a) | |
(FactorialMonoid a, IsString a) => IsString (Measured a) | |
StableFactorialMonoid a => Monoid (Measured a) | |
StableFactorialMonoid a => PositiveMonoid (Measured a) | |
StableFactorialMonoid a => MonoidNull (Measured a) | |
StableFactorialMonoid a => StableFactorialMonoid (Measured a) | |
StableFactorialMonoid a => FactorialMonoid (Measured a) | |
(RightGCDMonoid a, StableFactorialMonoid a) => RightGCDMonoid (Measured a) | |
(LeftGCDMonoid a, StableFactorialMonoid a) => LeftGCDMonoid (Measured a) | |
(RightReductiveMonoid a, StableFactorialMonoid a) => RightReductiveMonoid (Measured a) | |
(LeftReductiveMonoid a, StableFactorialMonoid a) => LeftReductiveMonoid (Measured a) | |
(Eq a, TextualMonoid a, StableFactorialMonoid a) => TextualMonoid (Measured a) |
inject :: FactorialMonoid a => a -> Measured a Source
Deprecated: Use measure instead.
measure :: FactorialMonoid a => a -> Measured a Source
Create a new Measured
value.