prob-fx-0.1.0.1: A library for modular probabilistic modelling
Safe HaskellNone
LanguageHaskell2010

Effects.Dist

Description

The effect Dist for primitive distributions

Synopsis

Address

type Tag = String Source #

An observable variable name assigned to a primitive distribution

type Addr = (Tag, Int) Source #

An observable variable name and the index of its run-time occurrence

Dist effect

data Dist a Source #

Distribution effect

Constructors

Dist 

Fields

Instances

Instances details
Eq (Dist a) Source # 
Instance details

Defined in Effects.Dist

Methods

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

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

Show a => Show (Dist a) Source # 
Instance details

Defined in Effects.Dist

Methods

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

show :: Dist a -> String #

showList :: [Dist a] -> ShowS #

handleDist :: (Member Sample es, Member Observe es) => Prog (Dist ': es) a -> Prog es a Source #

Handle the Dist effect to a Sample or Observe effect and assign an address

Sample effect

data Sample a where Source #

The effect for sampling from distirbutions

Constructors

Sample 

Fields

Observe effect

data Observe a where Source #

The effect for conditioning against observed values

Constructors

Observe 

Fields

  • :: PrimDist a

    Distribution to condition with

  • -> a

    Observed value

  • -> Addr

    Address of Observe operation

  • -> Observe a