hakaru-0.1.2: A probabilistic programming embedded DSL

Safe HaskellNone

Language.Hakaru.Syntax

Documentation

data Dist a Source

class Mochastic repr whereSource

Associated Types

type Type repr a :: ConstraintSource

Methods

real :: Double -> repr DoubleSource

bool :: Bool -> repr BoolSource

add, mul :: repr Double -> repr Double -> repr DoubleSource

neg :: repr Double -> repr DoubleSource

logFloat, logToLogFloat :: repr Double -> repr ProbSource

unbool :: repr Bool -> repr c -> repr c -> repr cSource

pair :: repr a -> repr b -> repr (a, b)Source

unpair :: repr (a, b) -> (repr a -> repr b -> repr c) -> repr cSource

inl :: repr a -> repr (Either a b)Source

inr :: repr b -> repr (Either a b)Source

uneither :: repr (Either a b) -> (repr a -> repr c) -> (repr b -> repr c) -> repr cSource

nil :: repr [a]Source

cons :: repr a -> repr [a] -> repr [a]Source

unlist :: repr [a] -> repr c -> (repr a -> repr [a] -> repr c) -> repr cSource

ret :: repr a -> repr (Measure a)Source

bind :: repr (Measure a) -> (repr a -> repr (Measure b)) -> repr (Measure b)Source

conditioned, unconditioned :: repr (Dist a) -> repr (Measure a)Source

factor :: repr Prob -> repr (Measure ())Source

dirac :: Type repr a => repr a -> repr (Dist a)Source

categorical :: Type repr a => repr [(a, Prob)] -> repr (Dist a)Source

bern :: Type repr Bool => repr Double -> repr (Dist Bool)Source

normal, uniform :: repr Double -> repr Double -> repr (Dist Double)Source

poisson :: repr Double -> repr (Dist Int)Source

Instances

data AST repr a whereSource

Constructors

Real :: Double -> AST repr Double 
Unbool :: AST repr Bool -> AST repr c -> AST repr c -> AST repr c 
Categorical :: Type repr a => AST repr [(a, Prob)] -> AST repr (Dist a) 

Instances

Mochastic repr => Mochastic (AST repr) 

eval :: Mochastic repr => AST repr a -> repr aSource

newtype PP a Source

Constructors

PP (Int -> Doc) 

newtype IS a Source

Constructors

IS (IS' a) 

Instances

type family IS' a Source

newtype MH a Source

Constructors

MH (MH' a) 

Instances

type family MH' a Source