FUNCTIONAL PEARLS: Probabilistic functional programming in Haskell

  • Authors:
  • Martin Erwig;Steve Kollmansberger

  • Affiliations:
  • School of Electrical Engineering and Computer Science, Oregon State University, Corvallis, OR 97331, USA (e-mail: erwig@eecs.oregonstate.edu, kollmast@eecs.oregonstate.edu);School of Electrical Engineering and Computer Science, Oregon State University, Corvallis, OR 97331, USA (e-mail: erwig@eecs.oregonstate.edu, kollmast@eecs.oregonstate.edu)

  • Venue:
  • Journal of Functional Programming
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

At the heart of functional programming rests the principle of referential transparency, which in particular means that a function f applied to a value x always yields one and the same value y=f(x). This principle seems to be violated when contemplating the use of functions to describe probabilistic events, such as rolling a die: It is not clear at all what exactly the outcome will be, and neither is it guaranteed that the same value will be produced repeatedly. However, these two seemingly incompatible notions can be reconciled if probabilistic values are encapsulated in a data type.