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.Density.Free

Description

Density is a free monad transformer over random sampling.

Synopsis

Documentation

data Density m a Source #

Free monad transformer over random sampling.

Uses the Church-encoded version of the free monad for efficiency.

Instances

Instances details
MonadTrans Density Source # 
Instance details

Defined in Control.Monad.Bayes.Density.Free

Methods

lift :: Monad m => m a -> Density m a #

Applicative (Density m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.Free

Methods

pure :: a -> Density m a #

(<*>) :: Density m (a -> b) -> Density m a -> Density m b #

liftA2 :: (a -> b -> c) -> Density m a -> Density m b -> Density m c #

(*>) :: Density m a -> Density m b -> Density m b #

(<*) :: Density m a -> Density m b -> Density m a #

Functor (Density m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.Free

Methods

fmap :: (a -> b) -> Density m a -> Density m b #

(<$) :: a -> Density m b -> Density m a #

Monad (Density m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.Free

Methods

(>>=) :: Density m a -> (a -> Density m b) -> Density m b #

(>>) :: Density m a -> Density m b -> Density m b #

return :: a -> Density m a #

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

Defined in Control.Monad.Bayes.Density.Free

hoist :: (Monad m, Monad n) => (forall x. m x -> n x) -> Density m a -> Density n a Source #

Hoist Density through a monad transform.

interpret :: MonadDistribution m => Density m a -> m a Source #

Execute random sampling in the transformed monad.

withRandomness :: Monad m => [Double] -> Density m a -> m a Source #

Execute computation with supplied values for random choices.

density :: MonadDistribution m => [Double] -> Density m a -> m (a, [Double]) Source #

Execute computation with supplied values for a subset of random choices. Return the output value and a record of all random choices used, whether taken as input or drawn using the transformed monad.

traced :: MonadDistribution m => [Double] -> Density Identity a -> m (a, [Double]) Source #

Like density, but use an arbitrary sampling monad.