distribution-1.1.0.0: Finite discrete probability distributions.

Safe HaskellSafe
LanguageHaskell98

Data.Distribution.Domain.Dice

Contents

Description

This modules provides distributions from dice and functions on dice.

Synopsis

Dice

type Dice = Distribution Int Source #

Distribution of the result of dice rolls.

dice :: Int -> Dice Source #

Fair dice of n faces.

Common dice

d4 :: Dice Source #

Fair dice of 4 faces.

d6 :: Dice Source #

Fair dice of 6 faces.

d8 :: Dice Source #

Fair dice of 8 faces.

d10 :: Dice Source #

Fair dice of 10 faces.

d20 :: Dice Source #

Fair dice of 20 faces.

Operations

rollsOf :: Int -> Dice -> Dice Source #

Rolls n times the given dice and sums the results.

rerollOn :: (Int -> Bool) -> Dice -> Dice Source #

Rerolls the dice once if the first outcome satifies the given predicate.