Modular Probabilistic Models via Algebraic Effects

Minh H Nguyen, Roly N T Perera, Meng Wang*, Nicolas Wu

*Corresponding author for this work

Research output: Contribution to journalArticle (Academic Journal)peer-review

13 Downloads (Pure)


Probabilistic programming languages (PPLs) allow programmers to construct statistical models and then simulate data or perform inference over them. Many PPLs restrict models to a particular instance of simulation or inference, limiting their reusability. In other PPLs, models are not readily composable. Using Haskell as the host language, we present an embedded domain specific language based on algebraic effects, where probabilistic models are modular, first-class, and reusable for both simulation and inference. We also demonstrate how simulation and inference can be expressed naturally as composable program transformations using algebraic effect handlers.
Original languageEnglish
Article number104
Pages (from-to)381-410
JournalProceedings of the ACM on Programming Languages
Issue numberICFP
Early online date31 Aug 2022
Publication statusPublished - 11 Sept 2022

Bibliographical note

Funding Information:
Our sincere thanks to Matija Pretnar for shepherding this paper during the conditional acceptance phase, and to the anonymous reviewers for their valuable discussion. We also thank Alessio Zakaria who has been a constant source of support and drive behind our ideas, and the members of the Bristol Programming Languages research group for creating the wonderful environment for this work. This work is partly supported by the EPSRC grant EXHIBIT : Expressive High-Level Languages for Bidirectional Transformations (EP/T008911/1).

Publisher Copyright:
© 2022 Owner/Author.

Structured keywords

  • Programming Languages


Dive into the research topics of 'Modular Probabilistic Models via Algebraic Effects'. Together they form a unique fingerprint.

Cite this