Safe Haskell | None |
---|

This module defines the monoid transformer data type `Measured`

.

# Documentation

is a wrapper around the `Measured`

a`FactorialMonoid`

`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 aSource