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

Control.Monad.Bayes.Density.State

Description

Slower than Control.Monad.Bayes.Density.Free, so not used by default, but more elementary to understand. Just uses standard monad transformer techniques.

Documentation

newtype Density m a Source #

Constructors

Density 

Fields

Instances

Instances details
MonadTrans Density Source # 
Instance details

Defined in Control.Monad.Bayes.Density.State

Methods

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

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

Defined in Control.Monad.Bayes.Density.State

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 m => Functor (Density m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.State

Methods

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

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

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

Defined in Control.Monad.Bayes.Density.State

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 #

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

Defined in Control.Monad.Bayes.Density.State

Monad m => MonadState [Double] (Density m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.State

Methods

get :: Density m [Double] #

put :: [Double] -> Density m () #

state :: ([Double] -> (a, [Double])) -> Density m a #

Monad m => MonadWriter [Double] (Density m) Source # 
Instance details

Defined in Control.Monad.Bayes.Density.State

Methods

writer :: (a, [Double]) -> Density m a #

tell :: [Double] -> Density m () #

listen :: Density m a -> Density m (a, [Double]) #

pass :: Density m (a, [Double] -> [Double]) -> Density m a #

density :: Monad m => Density m b -> [Double] -> m (b, [Double]) Source #