monad-bayes-1.1.1: A library for probabilistic programming.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Bayes.Integrator

Description

This is adapted from https://jtobin.io/giry-monad-implementation but brought into the monad-bayes framework (i.e. Integrator is an instance of MonadMeasure) It's largely for debugging other inference methods and didactic use, because brute force integration of measures is only practical for small programs

Documentation

probability :: Ord a => (a, a) -> Integrator a -> Double Source #

enumeratorWith :: Ord a => Set a -> Integrator a -> [(a, Double)] Source #

histogram :: (Enum a, Ord a, Fractional a) => Int -> a -> Weighted Integrator a -> [(a, Double)] Source #

data Integrator a Source #

Instances

Instances details
Applicative Integrator Source # 
Instance details

Defined in Control.Monad.Bayes.Integrator

Methods

pure :: a -> Integrator a #

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

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

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

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

Functor Integrator Source # 
Instance details

Defined in Control.Monad.Bayes.Integrator

Methods

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

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

Monad Integrator Source # 
Instance details

Defined in Control.Monad.Bayes.Integrator

Methods

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

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

return :: a -> Integrator a #

MonadDistribution Integrator Source # 
Instance details

Defined in Control.Monad.Bayes.Integrator

Num a => Num (Integrator a) Source # 
Instance details

Defined in Control.Monad.Bayes.Integrator