Copyright | (c) Edward Kmett 2013 |
---|---|

License | BSD3 |

Maintainer | Edward Kmett <ekmett@gmail.com> |

Stability | experimental |

Portability | non-portable |

Safe Haskell | None |

Language | Haskell98 |

## Synopsis

- data Approximate a = Approximate !(Log Double) a
- class HasApproximate c a | c -> a where
- approximate :: Lens' c (Approximate a)
- confidence :: Lens' c (Log Double)
- estimate :: Lens' c a
- hi :: Lens' c a
- lo :: Lens' c a

- exact :: Eq a => Prism' (Approximate a) a
- zero :: (Num a, Eq a) => Prism' (Approximate a) ()
- one :: (Num a, Eq a) => Prism' (Approximate a) ()
- withMin :: Ord a => a -> Approximate a -> Approximate a
- withMax :: Ord a => a -> Approximate a -> Approximate a

# Documentation

data Approximate a Source #

An approximate number, with a likely interval, an expected value and a lower bound on the `log`

of probability that the answer falls in the interval.

*NB:* The probabilities associated with confidence are stored in the `log`

domain.

Approximate !(Log Double) a |

## Instances

class HasApproximate c a | c -> a where Source #

approximate :: Lens' c (Approximate a) Source #

confidence :: Lens' c (Log Double) Source #

## Instances

HasApproximate (Approximate a) a Source # | |

Defined in Data.Approximate.Type approximate :: Lens' (Approximate a) (Approximate a) Source # confidence :: Lens' (Approximate a) (Log Double) Source # estimate :: Lens' (Approximate a) a Source # hi :: Lens' (Approximate a) a Source # lo :: Lens' (Approximate a) a Source # |

withMin :: Ord a => a -> Approximate a -> Approximate a Source #

withMax :: Ord a => a -> Approximate a -> Approximate a Source #