Tag Archives: random

Monad transformers: a cautionary tale

When writing the code in my previous post, I wanted to have a monad which combined the ability to generate random numbers with the ability to fail. Naturally, I decided to use RandT Maybe. But when I tried to write … Continue reading

Posted in haskell | Tagged , , , | Leave a comment

Random binary trees with a size-limited critical Boltzmann sampler

Today I’d like to talk about generating random trees. First, some imports and such (this post is literate Haskell). > {-# LANGUAGE GeneralizedNewtypeDeriving #-} > > module BoltzmannTrees where > > import Control.Applicative > import Control.Arrow ((&&&)) > import Control.Lens … Continue reading

Posted in combinatorics, haskell, math, species | Tagged , , , , , | 11 Comments