planet-mitchell-0.0.0: Planet Mitchell

Safe HaskellNone
LanguageHaskell2010

Numeric.Approximate

Contents

Synopsis

Approximate

data Approximate a #

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.

Constructors

Approximate !(Log Double) a a a 
Instances
Functor Approximate 
Instance details

Defined in Data.Approximate.Type

Methods

fmap :: (a -> b) -> Approximate a -> Approximate b #

(<$) :: a -> Approximate b -> Approximate a #

Applicative Approximate 
Instance details

Defined in Data.Approximate.Type

Methods

pure :: a -> Approximate a #

(<*>) :: Approximate (a -> b) -> Approximate a -> Approximate b #

liftA2 :: (a -> b -> c) -> Approximate a -> Approximate b -> Approximate c #

(*>) :: Approximate a -> Approximate b -> Approximate b #

(<*) :: Approximate a -> Approximate b -> Approximate a #

Foldable Approximate 
Instance details

Defined in Data.Approximate.Type

Methods

fold :: Monoid m => Approximate m -> m #

foldMap :: Monoid m => (a -> m) -> Approximate a -> m #

foldr :: (a -> b -> b) -> b -> Approximate a -> b #

foldr' :: (a -> b -> b) -> b -> Approximate a -> b #

foldl :: (b -> a -> b) -> b -> Approximate a -> b #

foldl' :: (b -> a -> b) -> b -> Approximate a -> b #

foldr1 :: (a -> a -> a) -> Approximate a -> a #

foldl1 :: (a -> a -> a) -> Approximate a -> a #

toList :: Approximate a -> [a] #

null :: Approximate a -> Bool #

length :: Approximate a -> Int #

elem :: Eq a => a -> Approximate a -> Bool #

maximum :: Ord a => Approximate a -> a #

minimum :: Ord a => Approximate a -> a #

sum :: Num a => Approximate a -> a #

product :: Num a => Approximate a -> a #

Traversable Approximate 
Instance details

Defined in Data.Approximate.Type

Methods

traverse :: Applicative f => (a -> f b) -> Approximate a -> f (Approximate b) #

sequenceA :: Applicative f => Approximate (f a) -> f (Approximate a) #

mapM :: Monad m => (a -> m b) -> Approximate a -> m (Approximate b) #

sequence :: Monad m => Approximate (m a) -> m (Approximate a) #

Serial1 Approximate 
Instance details

Defined in Data.Approximate.Type

Methods

serializeWith :: MonadPut m => (a -> m ()) -> Approximate a -> m () #

deserializeWith :: MonadGet m => m a -> m (Approximate a) #

Hashable1 Approximate 
Instance details

Defined in Data.Approximate.Type

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Approximate a -> Int #

Apply Approximate 
Instance details

Defined in Data.Approximate.Type

Methods

(<.>) :: Approximate (a -> b) -> Approximate a -> Approximate b #

(.>) :: Approximate a -> Approximate b -> Approximate b #

(<.) :: Approximate a -> Approximate b -> Approximate a #

liftF2 :: (a -> b -> c) -> Approximate a -> Approximate b -> Approximate c #

Pointed Approximate 
Instance details

Defined in Data.Approximate.Type

Methods

point :: a -> Approximate a #

Copointed Approximate 
Instance details

Defined in Data.Approximate.Type

Methods

copoint :: Approximate a -> a #

Unbox a => Vector Vector (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Unbox a => MVector MVector (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Eq a => Eq (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Data a => Data (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Methods

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

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

toConstr :: Approximate a -> Constr #

dataTypeOf :: Approximate a -> DataType #

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

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

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

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

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

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

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

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

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

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

(Ord a, Num a) => Num (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Read a => Read (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Show a => Show (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Generic (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Associated Types

type Rep (Approximate a) :: * -> * #

Methods

from :: Approximate a -> Rep (Approximate a) x #

to :: Rep (Approximate a) x -> Approximate a #

Hashable a => Hashable (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Methods

hashWithSalt :: Int -> Approximate a -> Int #

hash :: Approximate a -> Int #

Binary a => Binary (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Methods

put :: Approximate a -> Put #

get :: Get (Approximate a) #

putList :: [Approximate a] -> Put #

Serial a => Serial (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Methods

serialize :: MonadPut m => Approximate a -> m () #

deserialize :: MonadGet m => m (Approximate a) #

Serialize a => Serialize (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Methods

put :: Putter (Approximate a) #

get :: Get (Approximate a) #

NFData a => NFData (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Methods

rnf :: Approximate a -> () #

Unbox a => Unbox (Approximate a) 
Instance details

Defined in Data.Approximate.Type

Serialize a => SafeCopy (Approximate a) 
Instance details

Defined in Data.Approximate.Type

HasApproximate (Approximate a) a 
Instance details

Defined in Data.Approximate.Type

data MVector s (Approximate a) 
Instance details

Defined in Data.Approximate.Type

data MVector s (Approximate a) = MV_Approximate (MVector s (Log Double, a, a, a))
type Rep (Approximate a) 
Instance details

Defined in Data.Approximate.Type

type Rep (Approximate a) = D1 (MetaData "Approximate" "Data.Approximate.Type" "approximate-0.3.1-JRm3jRSyRQV67mP5kpCJmD" False) (C1 (MetaCons "Approximate" PrefixI True) ((S1 (MetaSel (Just "_confidence") SourceUnpack SourceStrict DecidedStrict) (Rec0 (Log Double)) :*: S1 (MetaSel (Just "_lo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) :*: (S1 (MetaSel (Just "_estimate") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: S1 (MetaSel (Just "_hi") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))))
data Vector (Approximate a) 
Instance details

Defined in Data.Approximate.Type

class HasApproximate c a | c -> a where #

Minimal complete definition

approximate

Methods

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 #