Tag Archives: generation

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 , , , , , | 7 Comments

Idempotent Template Haskell

Yesterday I was looking for a way to have some Template Haskell code generate a definition for a certain identifier if and only if such a definition did not already exist. Essentially I want to be able to call the … Continue reading

Posted in haskell | Tagged , , , | 2 Comments