monus-weighted-search-0.1.0.0: Efficient search weighted by an ordered monoid with monus.
Copyright(c) Donnacha Oisín Kidney 2021
Maintainermail@doisinkidney.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

MonusWeightedSearch.Examples.Sampling

Description

Random sampling from the Heap monad.

The Heap monad can function as a probability monad, and it implements an efficient sampling algorithm, based on reservoir sampling.

Synopsis

Documentation

sample :: Heap Prob a -> IO a Source #

Sample a single value from the heap.