monad-bayes: A library for probabilistic programming.

[ library, mit, program, statistics ] [ Propose Tags ]

A library for probabilistic programming using probability monads. The emphasis is on composition of inference algorithms implemented in terms of monad transformers. Please refer to the documentation for a quick-start user guide and a reference overview of how it all works" and the included README.

[Skip to Readme]


Manual Flags


Turn on development settings.


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS],, 1.0.0, 1.1.0
Change log
Dependencies base (>=4.11 && <4.17), brick (>=1.0 && <2.0), containers (>=0.5.10 && <0.7), foldl, free (>=5.0.2 && <5.2), histogram-fill, ieee754 (>=0.8.0 && <0.9), integration, lens, linear, log-domain (>=0.12 && <0.14), math-functions (>=0.2.1 && <0.4), matrix, monad-bayes, monad-coroutine (>=0.9.0 && <0.10), monad-extras, mtl (>=2.2.2 && <2.3), mwc-random (>=0.13.6 && <0.16), optparse-applicative, pipes, pretty-simple, primitive, random, safe (>=0.3.17 && <0.4), scientific, statistics (>=0.14.0 && <0.17), text, time, vector (>=0.12.0 && <0.13), vty [details]
License MIT
Copyright 2015-2020 Adam Scibior
Author Adam Scibior <>
Category Statistics
Home page
Bug tracker
Source repo head: git clone
Uploaded by DominicSteinitz at 2022-11-06T13:40:51Z
Distributions NixOS:1.1.0
Executables example
Downloads 837 total (26 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-11-06 [all 1 reports]

Readme for monad-bayes-1.1.0

[back to package description]


A library for probabilistic programming in Haskell.

See the website for an overview of the documentation, library, tutorials, examples (and a link to this very source code).

Created by Adam Scibior (@adscib), documentation, website and newer features by Reuben, maintained by Tweag.

Project status

Now that monad-bayes has been released on Hackage, and the documentation and the API has been updated, we will focus on adding new features. See the Github issues to get a sense of what is being prepared, and please feel free to make requests.


The basis for the code in this repository is the ICFP 2018 paper [2]. For the code associated with the Haskell2015 paper [1], see the haskell2015 tag.

[1] Adam M. Ścibior, Zoubin Ghahramani, and Andrew D. Gordon. 2015. Practical probabilistic programming with monads. In Proceedings of the 2015 ACM SIGPLAN Symposium on Haskell (Haskell ’15), Association for Computing Machinery, Vancouver, BC, Canada, 165–176.

[2] Adam M. Ścibior, Ohad Kammar, and Zoubin Ghahramani. 2018. Functional programming for modular Bayesian inference. In Proceedings of the ACM on Programming Languages Volume 2, ICFP (July 2018), 83:1–83:29.

[3] Adam M. Ścibior. 2019. Formally justified and modular Bayesian inference for probabilistic programs. Thesis. University of Cambridge.


  1. Install stack by following these instructions.

  2. Clone the repository using one of these URLs:

    git clone
    git clone

Now you can use stack build, stack test and stack ghci.

To view the notebooks, go to the website. To use the notebooks interactively:

  1. Compile the source: stack build
  2. If you do not have nix install it.
  3. Run nix develop --system x86_64-darwin --extra-experimental-features nix-command --extra-experimental-features flakes - this should open a nix shell. For Linux use x86_64-linux for --system option instead.
  4. Run jupyter-lab from the nix shell to load the notebooks.

Your mileage may vary.