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

Effects.Dist

Description

The effects for primitive distributions, sampling, and observing.

Synopsis

Address

Run-time identifiers for probabilistic operations

type Tag = String Source #

An observable variable name assigned to a primitive distribution, representing a compile-time identifier

type Addr = (Tag, Int) Source #

An observable variable name and the index of its run-time occurrence, representing a run-time identifier

Dist effect

data Dist a Source #

The effect Dist for primitive distributions

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 Sample for sampling from distirbutions

Constructors

Sample 

Fields

pattern Samp :: Member Sample es => PrimDist x -> Addr -> EffectSum es x Source #

For projecting and then successfully pattern matching against Sample

Observe effect

data Observe a where Source #

The effect Observe for conditioning against observed values

Constructors

Observe 

Fields

  • :: PrimDist a

    distribution to condition with

  • -> a

    observed value

  • -> Addr

    address of Observe operation

  • -> Observe a
     

pattern Obs :: Member Observe es => PrimDist x -> x -> Addr -> EffectSum es x Source #

For projecting and then successfully pattern matching against Observe