probability-0.2.5: Probabilistic Functional Programming

Safe HaskellSafe-Inferred
LanguageHaskell98

Numeric.Probability.Example.MontyHall

Contents

Synopsis

Documentation

data Door Source

Constructors

A 
B 
C 

Instances

data State Source

Constructors

Doors 

Fields

prize :: Door
 
chosen :: Door
 
opened :: Door
 

Instances

start :: State Source

initial configuration of the game status

hide :: Trans State Source

Steps of the game:

  1. hide the prize
  2. choose a door
  3. open a non-open door, not revealing the prize
  4. apply strategy: switch or stay

Playing the game

data Outcome Source

Constructors

Win 
Lose 

Alternative modeling

Play the game the monadic way