approximate-0.3.1: Approximate discrete values and numbers

Copyright(c) Edward Kmett 2013
LicenseBSD3
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

Data.Approximate.Type

Description

 

Synopsis

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.

Constructors

Approximate !(Log Double) a 

Instances

Functor Approximate Source # 

Methods

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

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

Applicative Approximate Source # 
Foldable Approximate Source # 

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 Source # 

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 Source # 

Methods

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

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

Hashable1 Approximate Source # 

Methods

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

Copointed Approximate Source # 

Methods

copoint :: Approximate a -> a #

Pointed Approximate Source # 

Methods

point :: a -> Approximate a #

Apply Approximate Source # 
Unbox a => Vector Vector (Approximate a) Source # 
Unbox a => MVector MVector (Approximate a) Source # 
Eq a => Eq (Approximate a) Source # 
Data a => Data (Approximate a) Source # 

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) Source # 
Read a => Read (Approximate a) Source # 
Show a => Show (Approximate a) Source # 
Generic (Approximate a) Source # 

Associated Types

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

Methods

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

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

Binary a => Binary (Approximate a) Source # 

Methods

put :: Approximate a -> Put #

get :: Get (Approximate a) #

putList :: [Approximate a] -> Put #

Serial a => Serial (Approximate a) Source # 

Methods

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

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

Serialize a => Serialize (Approximate a) Source # 

Methods

put :: Putter (Approximate a) #

get :: Get (Approximate a) #

NFData a => NFData (Approximate a) Source # 

Methods

rnf :: Approximate a -> () #

Hashable a => Hashable (Approximate a) Source # 

Methods

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

hash :: Approximate a -> Int #

Unbox a => Unbox (Approximate a) Source # 
Serialize a => SafeCopy (Approximate a) Source # 
HasApproximate (Approximate a0) a0 Source # 
data MVector s (Approximate a) Source # 
data MVector s (Approximate a) = MV_Approximate (MVector s (Log Double, a, a, a))
type Rep (Approximate a) Source # 
type Rep (Approximate a) = D1 (MetaData "Approximate" "Data.Approximate.Type" "approximate-0.3.1-FS3hJ0LU8K8BWgM9AgtLk8" False) (C1 (MetaCons "Approximate" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_confidence") SourceUnpack SourceStrict DecidedUnpack) (Rec0 (Log Double))) (S1 (MetaSel (Just Symbol "_lo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) ((:*:) (S1 (MetaSel (Just Symbol "_estimate") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) (S1 (MetaSel (Just Symbol "_hi") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))))
data Vector (Approximate a) Source # 

zero :: (Num a, Eq a) => Prism' (Approximate a) () Source #

one :: (Num a, Eq a) => Prism' (Approximate a) () Source #