deanie

An embedded probabilistic programming language.
git clone git://git.jtobin.io/deanie.git
Log | Files | Refs | README | LICENSE

Comonadic.hs (408B)


      1 
      2 module Deanie.Inference.Comonadic where
      3 
      4 import Control.Comonad.Cofree
      5 import Deanie.Language
      6 
      7 type Execution a = Cofree Program a
      8 
      9 initialize :: ProgramF a -> ()
     10 initialize = \case
     11     ProgramF branch -> case branch of
     12       InL term -> foo term
     13       InR term -> ()
     14   where
     15     foo = \case
     16       BernoulliF p _  -> ()
     17       BetaF a b _     -> ()
     18       GammaF a b _    -> ()
     19       GaussianF m s _ -> ()
     20 
     21 
     22