Safe Haskell | None |
---|---|
Language | Haskell2010 |
The effects for primitive distributions, sampling, and observing.
Synopsis
- type Tag = String
- type Addr = (Tag, Int)
- data Dist a = Dist {}
- handleDist :: (Member Sample es, Member Observe es) => Prog (Dist ': es) a -> Prog es a
- data Sample a where
- pattern Samp :: Member Sample es => PrimDist x -> Addr -> EffectSum es x
- data Observe a where
- pattern Obs :: Member Observe es => PrimDist x -> x -> Addr -> EffectSum es x
Address
Run-time identifiers for probabilistic operations
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
The effect Dist
for primitive distributions
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
The effect Sample
for sampling from distirbutions
pattern Samp :: Member Sample es => PrimDist x -> Addr -> EffectSum es x Source #
For projecting and then successfully pattern matching against Sample
Observe effect
The effect Observe
for conditioning against observed values