Hakaru嵌入式编程语言
Hakaru 是一个嵌入式编程语言,用于 Haskell。
安装:
cabal update cabal install hakaru
简单实例:
import Control.Monad (replicateM) import Data.Dynamic (toDyn) import Language.Hakaru.Types import Language.Hakaru.Distribution import Language.Hakaru.Metropolis heads = Just (toDyn (Discrete True)) prog :: Measure Double prog = do bias <- unconditioned (beta 1 1) replicateM 10 $ conditioned (bern bias) return bias sample prog (replicate 10 heads)
评论