Portability | non-portable |
---|---|

Stability | experimental |

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

Safe Haskell | None |

- data Approximate a = Approximate !(Log Double) a a a
- class HasApproximate t a | t -> a where
- approximate :: Lens' t (Approximate a)
- confidence :: Lens' t (Log Double)
- estimate :: Lens' t a
- hi :: Lens' t a
- lo :: Lens' t 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 a a |

Functor Approximate | |

Typeable1 Approximate | |

Applicative Approximate | |

Foldable Approximate | |

Traversable Approximate | |

Serial1 Approximate | |

Hashable1 Approximate | |

Pointed Approximate | |

Copointed Approximate | |

Apply Approximate | |

Unbox a => Vector Vector (Approximate a) | |

Unbox a => MVector MVector (Approximate a) | |

Eq a => Eq (Approximate a) | |

Data a => Data (Approximate a) | |

(Ord a, Num a) => Num (Approximate a) | |

Read a => Read (Approximate a) | |

Show a => Show (Approximate a) | |

Generic (Approximate a) | |

Binary a => Binary (Approximate a) | |

Serial a => Serial (Approximate a) | |

Serialize a => Serialize (Approximate a) | |

NFData a => NFData (Approximate a) | |

Hashable a => Hashable (Approximate a) | |

Unbox a => Unbox (Approximate a) | |

Serialize a => SafeCopy (Approximate a) | |

HasApproximate (Approximate a0) a0 |

class HasApproximate t a | t -> a whereSource

approximate :: Lens' t (Approximate a)Source

confidence :: Lens' t (Log Double)Source

HasApproximate (Approximate a0) a0 |

exact :: Eq a => Prism' (Approximate a) aSource

withMin :: Ord a => a -> Approximate a -> Approximate aSource

withMax :: Ord a => a -> Approximate a -> Approximate aSource