monad-bayes-1.1.1: A library for probabilistic programming.
Copyright(c) Adam Scibior 2015-2020
LicenseMIT
Maintainerleonhard.markert@tweag.io
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Bayes.Class

Description

This module defines MonadMeasure, which can be used to represent any probabilistic program, such as the following:

import Control.Monad (when)
import Control.Monad.Bayes.Class

model :: MonadMeasure m => m Bool
model = do
  rain <- bernoulli 0.3
  sprinkler <-
    bernoulli $
    if rain
      then 0.1
      else 0.4
  let wetProb =
    case (rain, sprinkler) of
      (True,  True)  -> 0.98
      (True,  False) -> 0.80
      (False, True)  -> 0.90
      (False, False) -> 0.00
  score wetProb
  return rain
Synopsis

Documentation

class Monad m => MonadDistribution m Source #

Monads that can draw random variables.

Minimal complete definition

random

Instances

Instances details
MonadDistribution Enumerator Source # 
Instance details

Defined in Control.Monad.Bayes.Enumerator

MonadDistribution Integrator Source # 
Instance details

Defined in Control.Monad.Bayes.Integrator

MonadDistribution Sampler Source # 
Instance details

Defined in Control.Monad.Bayes.Sampler.Lazy

Monad m => MonadDistribution (Density m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.Free

MonadDistribution m => MonadDistribution (Density m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.State

MonadDistribution m => MonadDistribution (SMC2 m) Source # 
Instance details

Defined in Control.Monad.Bayes.Inference.SMC2

MonadDistribution m => MonadDistribution (Population m) Source # 
Instance details

Defined in Control.Monad.Bayes.Population

MonadDistribution m => MonadDistribution (Sequential m) Source # 
Instance details

Defined in Control.Monad.Bayes.Sequential.Coroutine

MonadDistribution m => MonadDistribution (Traced m) Source # 
Instance details

Defined in Control.Monad.Bayes.Traced.Basic

MonadDistribution m => MonadDistribution (Traced m) Source # 
Instance details

Defined in Control.Monad.Bayes.Traced.Dynamic

MonadDistribution m => MonadDistribution (Traced m) Source # 
Instance details

Defined in Control.Monad.Bayes.Traced.Static

MonadDistribution m => MonadDistribution (Weighted m) Source # 
Instance details

Defined in Control.Monad.Bayes.Weighted

MonadDistribution m => MonadDistribution (ListT m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

StatefulGen g m => MonadDistribution (Sampler g m) Source # 
Instance details

Defined in Control.Monad.Bayes.Sampler.Strict

MonadDistribution m => MonadDistribution (ExceptT e m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

MonadDistribution m => MonadDistribution (IdentityT m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

MonadDistribution m => MonadDistribution (ReaderT r m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

MonadDistribution m => MonadDistribution (StateT s m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

(Monoid w, MonadDistribution m) => MonadDistribution (WriterT w m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

MonadDistribution m => MonadDistribution (ContT r m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

random Source #

Arguments

:: MonadDistribution m 
=> m Double

\(\sim \mathcal{U}(0, 1)\)

Draw from a uniform distribution.

uniform Source #

Arguments

:: MonadDistribution m 
=> Double

lower bound a

-> Double

upper bound b

-> m Double

\(\sim \mathcal{U}(a, b)\).

Draw from a uniform distribution.

normal Source #

Arguments

:: MonadDistribution m 
=> Double

mean μ

-> Double

standard deviation σ

-> m Double

\(\sim \mathcal{N}(\mu, \sigma^2)\)

Draw from a normal distribution.

gamma Source #

Arguments

:: MonadDistribution m 
=> Double

shape k

-> Double

scale θ

-> m Double

\(\sim \Gamma(k, \theta)\)

Draw from a gamma distribution.

beta Source #

Arguments

:: MonadDistribution m 
=> Double

shape α

-> Double

shape β

-> m Double

\(\sim \mathrm{Beta}(\alpha, \beta)\)

Draw from a beta distribution.

bernoulli Source #

Arguments

:: MonadDistribution m 
=> Double

probability p

-> m Bool

\(\sim \mathrm{B}(1, p)\)

Draw from a Bernoulli distribution.

categorical Source #

Arguments

:: (MonadDistribution m, Vector v Double) 
=> v Double

event probabilities

-> m Int

outcome category

Draw from a categorical distribution.

logCategorical Source #

Arguments

:: (MonadDistribution m, Vector v (Log Double), Vector v Double) 
=> v (Log Double)

event probabilities

-> m Int

outcome category

Draw from a categorical distribution in the log domain.

uniformD Source #

Arguments

:: MonadDistribution m 
=> [a]

observable outcomes xs

-> m a

\(\sim \mathcal{U}\{\mathrm{xs}\}\)

Draw from a discrete uniform distribution.

geometric Source #

Arguments

:: MonadDistribution m 
=> Double

success rate p

-> m Int

\(\sim\) number of failed Bernoulli trials with success probability p before first success

Draw from a geometric distribution.

poisson Source #

Arguments

:: MonadDistribution m 
=> Double

parameter λ

-> m Int

\(\sim \mathrm{Pois}(\lambda)\)

Draw from a Poisson distribution.

dirichlet Source #

Arguments

:: (MonadDistribution m, Vector v Double) 
=> v Double

concentration parameters as

-> m (v Double)

\(\sim \mathrm{Dir}(\mathrm{as})\)

Draw from a Dirichlet distribution.

class Monad m => MonadFactor m Source #

Monads that can score different execution paths.

Minimal complete definition

score

Instances

Instances details
MonadFactor Enumerator Source # 
Instance details

Defined in Control.Monad.Bayes.Enumerator

Methods

score :: Log Double -> Enumerator () Source #

Monad m => MonadFactor (SMC2 m) Source # 
Instance details

Defined in Control.Monad.Bayes.Inference.SMC2

Methods

score :: Log Double -> SMC2 m () Source #

Monad m => MonadFactor (Population m) Source # 
Instance details

Defined in Control.Monad.Bayes.Population

Methods

score :: Log Double -> Population m () Source #

MonadFactor m => MonadFactor (Sequential m) Source #

Execution is suspended after each score.

Instance details

Defined in Control.Monad.Bayes.Sequential.Coroutine

Methods

score :: Log Double -> Sequential m () Source #

MonadFactor m => MonadFactor (Traced m) Source # 
Instance details

Defined in Control.Monad.Bayes.Traced.Basic

Methods

score :: Log Double -> Traced m () Source #

MonadFactor m => MonadFactor (Traced m) Source # 
Instance details

Defined in Control.Monad.Bayes.Traced.Dynamic

Methods

score :: Log Double -> Traced m () Source #

MonadFactor m => MonadFactor (Traced m) Source # 
Instance details

Defined in Control.Monad.Bayes.Traced.Static

Methods

score :: Log Double -> Traced m () Source #

Monad m => MonadFactor (Weighted m) Source # 
Instance details

Defined in Control.Monad.Bayes.Weighted

Methods

score :: Log Double -> Weighted m () Source #

MonadFactor m => MonadFactor (ListT m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

Methods

score :: Log Double -> ListT m () Source #

MonadFactor m => MonadFactor (ExceptT e m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

Methods

score :: Log Double -> ExceptT e m () Source #

MonadFactor m => MonadFactor (IdentityT m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

Methods

score :: Log Double -> IdentityT m () Source #

MonadFactor m => MonadFactor (ReaderT r m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

Methods

score :: Log Double -> ReaderT r m () Source #

MonadFactor m => MonadFactor (StateT s m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

Methods

score :: Log Double -> StateT s m () Source #

(Monoid w, MonadFactor m) => MonadFactor (WriterT w m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

Methods

score :: Log Double -> WriterT w m () Source #

MonadFactor m => MonadFactor (ContT r m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

Methods

score :: Log Double -> ContT r m () Source #

score Source #

Arguments

:: MonadFactor m 
=> Log Double

likelihood of the execution path

-> m () 

Record a likelihood.

factor Source #

Arguments

:: MonadFactor m 
=> Log Double

likelihood of the execution path

-> m () 

Synonym for score.

condition :: MonadFactor m => Bool -> m () Source #

Hard conditioning.

class (MonadDistribution m, MonadFactor m) => MonadMeasure m Source #

Monads that support both sampling and scoring.

Instances

Instances details
MonadMeasure Enumerator Source # 
Instance details

Defined in Control.Monad.Bayes.Enumerator

MonadDistribution m => MonadMeasure (SMC2 m) Source # 
Instance details

Defined in Control.Monad.Bayes.Inference.SMC2

MonadDistribution m => MonadMeasure (Population m) Source # 
Instance details

Defined in Control.Monad.Bayes.Population

MonadMeasure m => MonadMeasure (Sequential m) Source # 
Instance details

Defined in Control.Monad.Bayes.Sequential.Coroutine

MonadMeasure m => MonadMeasure (Traced m) Source # 
Instance details

Defined in Control.Monad.Bayes.Traced.Basic

MonadMeasure m => MonadMeasure (Traced m) Source # 
Instance details

Defined in Control.Monad.Bayes.Traced.Dynamic

MonadMeasure m => MonadMeasure (Traced m) Source # 
Instance details

Defined in Control.Monad.Bayes.Traced.Static

MonadDistribution m => MonadMeasure (Weighted m) Source # 
Instance details

Defined in Control.Monad.Bayes.Weighted

MonadMeasure m => MonadMeasure (ListT m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

MonadMeasure m => MonadMeasure (ExceptT e m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

MonadMeasure m => MonadMeasure (IdentityT m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

MonadMeasure m => MonadMeasure (ReaderT r m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

MonadMeasure m => MonadMeasure (StateT s m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

(Monoid w, MonadMeasure m) => MonadMeasure (WriterT w m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

MonadMeasure m => MonadMeasure (ContT r m) Source # 
Instance details

Defined in Control.Monad.Bayes.Class

discrete :: (DiscreteDistr d, MonadDistribution m) => d -> m Int Source #

Draw from a discrete distributions using the probability mass function.

normalPdf Source #

Arguments

:: Double

mean μ

-> Double

standard deviation σ

-> Double

sample x

-> Log Double

relative likelihood of observing sample x in \(\mathcal{N}(\mu, \sigma^2)\)

Probability density function of the normal distribution.

data Bayesian m z o Source #

a useful datatype for expressing bayesian models

Constructors

Bayesian 

Fields

posterior :: (MonadMeasure m, Foldable f, Functor f) => Bayesian m z o -> f o -> m z Source #

p(z|o)

priorPredictive :: Monad m => Bayesian m a b -> m b Source #

posteriorPredictive :: (MonadMeasure m, Foldable f, Functor f) => Bayesian m a b -> f b -> m b Source #

independent :: Applicative m => Int -> m a -> m [a] Source #

mvNormal :: MonadDistribution m => Vector Double -> Matrix Double -> m (Vector Double) Source #

multivariate normal

type Distribution a = forall m. MonadDistribution m => m a Source #

synonym for pretty type signatures, but note that (A -> Distribution B) won't work as intended: for that, use Kernel Also note that the use of RankNTypes means performance may take a hit: really the main point of these signatures is didactic

type Measure a = forall m. MonadMeasure m => m a Source #

type Kernel a b = forall m. MonadMeasure m => a -> m b Source #

newtype Log a #

Log-domain Float and Double values.

Constructors

Exp 

Fields

Instances

Instances details
Foldable Log 
Instance details

Defined in Numeric.Log

Methods

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

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

foldMap' :: Monoid m => (a -> m) -> Log a -> m #

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

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

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

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

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

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

toList :: Log a -> [a] #

null :: Log a -> Bool #

length :: Log a -> Int #

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

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

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

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

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

Eq1 Log 
Instance details

Defined in Numeric.Log

Methods

liftEq :: (a -> b -> Bool) -> Log a -> Log b -> Bool #

Traversable Log 
Instance details

Defined in Numeric.Log

Methods

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

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

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

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

Applicative Log 
Instance details

Defined in Numeric.Log

Methods

pure :: a -> Log a #

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

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

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

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

Functor Log 
Instance details

Defined in Numeric.Log

Methods

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

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

Monad Log 
Instance details

Defined in Numeric.Log

Methods

(>>=) :: Log a -> (a -> Log b) -> Log b #

(>>) :: Log a -> Log b -> Log b #

return :: a -> Log a #

Serial1 Log 
Instance details

Defined in Numeric.Log

Methods

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

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

Comonad Log 
Instance details

Defined in Numeric.Log

Methods

extract :: Log a -> a #

duplicate :: Log a -> Log (Log a) #

extend :: (Log a -> b) -> Log a -> Log b #

ComonadApply Log 
Instance details

Defined in Numeric.Log

Methods

(<@>) :: Log (a -> b) -> Log a -> Log b #

(@>) :: Log a -> Log b -> Log b #

(<@) :: Log a -> Log b -> Log a #

Distributive Log 
Instance details

Defined in Numeric.Log

Methods

distribute :: Functor f => f (Log a) -> Log (f a) #

collect :: Functor f => (a -> Log b) -> f a -> Log (f b) #

distributeM :: Monad m => m (Log a) -> Log (m a) #

collectM :: Monad m => (a -> Log b) -> m a -> Log (m b) #

Foldable1 Log 
Instance details

Defined in Numeric.Log

Methods

fold1 :: Semigroup m => Log m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Log a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Log a -> m #

toNonEmpty :: Log a -> NonEmpty a #

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

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

head :: Log a -> a #

last :: Log a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Log a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Log a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Log a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Log a -> b #

Hashable1 Log 
Instance details

Defined in Numeric.Log

Methods

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

Apply Log 
Instance details

Defined in Numeric.Log

Methods

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

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

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

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

Bind Log 
Instance details

Defined in Numeric.Log

Methods

(>>-) :: Log a -> (a -> Log b) -> Log b #

join :: Log (Log a) -> Log a #

Extend Log 
Instance details

Defined in Numeric.Log

Methods

duplicated :: Log a -> Log (Log a) #

extended :: (Log a -> b) -> Log a -> Log b #

Traversable1 Log 
Instance details

Defined in Numeric.Log

Methods

traverse1 :: Apply f => (a -> f b) -> Log a -> f (Log b) #

sequence1 :: Apply f => Log (f b) -> f (Log b) #

(RealFloat a, Unbox a) => Vector Vector (Log a) 
Instance details

Defined in Numeric.Log

Methods

basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) (Log a) -> m (Vector (Log a)) #

basicUnsafeThaw :: PrimMonad m => Vector (Log a) -> m (Mutable Vector (PrimState m) (Log a)) #

basicLength :: Vector (Log a) -> Int #

basicUnsafeSlice :: Int -> Int -> Vector (Log a) -> Vector (Log a) #

basicUnsafeIndexM :: Monad m => Vector (Log a) -> Int -> m (Log a) #

basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) (Log a) -> Vector (Log a) -> m () #

elemseq :: Vector (Log a) -> Log a -> b -> b #

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

Defined in Numeric.Log

Methods

basicLength :: MVector s (Log a) -> Int #

basicUnsafeSlice :: Int -> Int -> MVector s (Log a) -> MVector s (Log a) #

basicOverlaps :: MVector s (Log a) -> MVector s (Log a) -> Bool #

basicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) (Log a)) #

basicInitialize :: PrimMonad m => MVector (PrimState m) (Log a) -> m () #

basicUnsafeReplicate :: PrimMonad m => Int -> Log a -> m (MVector (PrimState m) (Log a)) #

basicUnsafeRead :: PrimMonad m => MVector (PrimState m) (Log a) -> Int -> m (Log a) #

basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) (Log a) -> Int -> Log a -> m () #

basicClear :: PrimMonad m => MVector (PrimState m) (Log a) -> m () #

basicSet :: PrimMonad m => MVector (PrimState m) (Log a) -> Log a -> m () #

basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) (Log a) -> MVector (PrimState m) (Log a) -> m () #

basicUnsafeMove :: PrimMonad m => MVector (PrimState m) (Log a) -> MVector (PrimState m) (Log a) -> m () #

basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) (Log a) -> Int -> m (MVector (PrimState m) (Log a)) #

Data a => Data (Log a) 
Instance details

Defined in Numeric.Log

Methods

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

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

toConstr :: Log a -> Constr #

dataTypeOf :: Log a -> DataType #

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

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

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

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

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

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

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

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

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

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

Storable a => Storable (Log a) 
Instance details

Defined in Numeric.Log

Methods

sizeOf :: Log a -> Int #

alignment :: Log a -> Int #

peekElemOff :: Ptr (Log a) -> Int -> IO (Log a) #

pokeElemOff :: Ptr (Log a) -> Int -> Log a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Log a) #

pokeByteOff :: Ptr b -> Int -> Log a -> IO () #

peek :: Ptr (Log a) -> IO (Log a) #

poke :: Ptr (Log a) -> Log a -> IO () #

RealFloat a => Monoid (Log a) 
Instance details

Defined in Numeric.Log

Methods

mempty :: Log a #

mappend :: Log a -> Log a -> Log a #

mconcat :: [Log a] -> Log a #

RealFloat a => Semigroup (Log a) 
Instance details

Defined in Numeric.Log

Methods

(<>) :: Log a -> Log a -> Log a #

sconcat :: NonEmpty (Log a) -> Log a #

stimes :: Integral b => b -> Log a -> Log a #

(RealFloat a, Enum a) => Enum (Log a) 
Instance details

Defined in Numeric.Log

Methods

succ :: Log a -> Log a #

pred :: Log a -> Log a #

toEnum :: Int -> Log a #

fromEnum :: Log a -> Int #

enumFrom :: Log a -> [Log a] #

enumFromThen :: Log a -> Log a -> [Log a] #

enumFromTo :: Log a -> Log a -> [Log a] #

enumFromThenTo :: Log a -> Log a -> Log a -> [Log a] #

RealFloat a => Floating (Log a) 
Instance details

Defined in Numeric.Log

Methods

pi :: Log a #

exp :: Log a -> Log a #

log :: Log a -> Log a #

sqrt :: Log a -> Log a #

(**) :: Log a -> Log a -> Log a #

logBase :: Log a -> Log a -> Log a #

sin :: Log a -> Log a #

cos :: Log a -> Log a #

tan :: Log a -> Log a #

asin :: Log a -> Log a #

acos :: Log a -> Log a #

atan :: Log a -> Log a #

sinh :: Log a -> Log a #

cosh :: Log a -> Log a #

tanh :: Log a -> Log a #

asinh :: Log a -> Log a #

acosh :: Log a -> Log a #

atanh :: Log a -> Log a #

log1p :: Log a -> Log a #

expm1 :: Log a -> Log a #

log1pexp :: Log a -> Log a #

log1mexp :: Log a -> Log a #

Generic (Log a) 
Instance details

Defined in Numeric.Log

Associated Types

type Rep (Log a) :: Type -> Type #

Methods

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

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

RealFloat a => Num (Log a) 
Instance details

Defined in Numeric.Log

Methods

(+) :: Log a -> Log a -> Log a #

(-) :: Log a -> Log a -> Log a #

(*) :: Log a -> Log a -> Log a #

negate :: Log a -> Log a #

abs :: Log a -> Log a #

signum :: Log a -> Log a #

fromInteger :: Integer -> Log a #

(Floating a, Read a) => Read (Log a) 
Instance details

Defined in Numeric.Log

RealFloat a => Fractional (Log a) 
Instance details

Defined in Numeric.Log

Methods

(/) :: Log a -> Log a -> Log a #

recip :: Log a -> Log a #

fromRational :: Rational -> Log a #

(RealFloat a, Ord a) => Real (Log a) 
Instance details

Defined in Numeric.Log

Methods

toRational :: Log a -> Rational #

RealFloat a => RealFrac (Log a) 
Instance details

Defined in Numeric.Log

Methods

properFraction :: Integral b => Log a -> (b, Log a) #

truncate :: Integral b => Log a -> b #

round :: Integral b => Log a -> b #

ceiling :: Integral b => Log a -> b #

floor :: Integral b => Log a -> b #

(Floating a, Show a) => Show (Log a) 
Instance details

Defined in Numeric.Log

Methods

showsPrec :: Int -> Log a -> ShowS #

show :: Log a -> String #

showList :: [Log a] -> ShowS #

Binary a => Binary (Log a) 
Instance details

Defined in Numeric.Log

Methods

put :: Log a -> Put #

get :: Get (Log a) #

putList :: [Log a] -> Put #

Serial a => Serial (Log a) 
Instance details

Defined in Numeric.Log

Methods

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

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

Serialize a => Serialize (Log a) 
Instance details

Defined in Numeric.Log

Methods

put :: Putter (Log a) #

get :: Get (Log a) #

NFData a => NFData (Log a) 
Instance details

Defined in Numeric.Log

Methods

rnf :: Log a -> () #

Eq a => Eq (Log a) 
Instance details

Defined in Numeric.Log

Methods

(==) :: Log a -> Log a -> Bool #

(/=) :: Log a -> Log a -> Bool #

Ord a => Ord (Log a) 
Instance details

Defined in Numeric.Log

Methods

compare :: Log a -> Log a -> Ordering #

(<) :: Log a -> Log a -> Bool #

(<=) :: Log a -> Log a -> Bool #

(>) :: Log a -> Log a -> Bool #

(>=) :: Log a -> Log a -> Bool #

max :: Log a -> Log a -> Log a #

min :: Log a -> Log a -> Log a #

Hashable a => Hashable (Log a) 
Instance details

Defined in Numeric.Log

Methods

hashWithSalt :: Int -> Log a -> Int #

hash :: Log a -> Int #

(RealFloat a, Unbox a) => Unbox (Log a) 
Instance details

Defined in Numeric.Log

newtype MVector s (Log a) 
Instance details

Defined in Numeric.Log

newtype MVector s (Log a) = MV_Log (MVector s a)
type Rep (Log a) 
Instance details

Defined in Numeric.Log

type Rep (Log a) = D1 ('MetaData "Log" "Numeric.Log" "log-domain-0.13.2-31fIEOmitp72uyos4KxyiE" 'True) (C1 ('MetaCons "Exp" 'PrefixI 'True) (S1 ('MetaSel ('Just "ln") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
newtype Vector (Log a) 
Instance details

Defined in Numeric.Log

newtype Vector (Log a) = V_Log (Vector a)