monad-bayes-1.3.0.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

DensityT is a free monad transformer over random sampling.

Synopsis

Documentation

newtype DensityT m a Source #

Free monad transformer over random sampling.

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

Constructors

DensityT 

Fields

Instances

Instances details
MonadTrans DensityT Source # 
Instance details

Defined in Control.Monad.Bayes.Density.Free

Methods

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

Applicative (DensityT m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.Free

Methods

pure :: a -> DensityT m a #

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

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

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

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

Functor (DensityT m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.Free

Methods

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

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

Monad (DensityT m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.Free

Methods

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

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

return :: a -> DensityT m a #

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

Defined in Control.Monad.Bayes.Density.Free

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

Hoist DensityT through a monad transform.

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

Execute random sampling in the transformed monad.

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

Execute computation with supplied values for random choices.

runDensityT :: MonadDistribution m => [Double] -> DensityT 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] -> DensityT Identity a -> m (a, [Double]) Source #

Like density, but use an arbitrary sampling monad.