Tag Archives: QuickCheck

What’s the right way to QuickCheck floating-point routines?

I got a lot of great comments on my previous post about finding roots of polynomials in Haskell. One particularly promising idea I got from commenter Jake was to give up on the idea of having no external dependencies (which, … Continue reading

Posted in haskell, math | Tagged , , , , , , , , , | 13 Comments

The generic-random library, part 1: simple generic Arbitrary instances

(Note, 9/21/2017: The generic-random package has been changed and updated quite a bit since I wrote this post. For more up-to-date information, see e.g. the tutorial included with the package.) In a previous post I pointed out that we know … Continue reading

Posted in combinatorics, haskell | Tagged , , , | 4 Comments

Boltzmann sampling for generic Arbitrary instances

Update, 7/17/2017: this now exists; see https://byorgey.wordpress.com/2016/09/20/the-generic-random-library-part-1-simple-generic-arbitrary-instances/ . tl;dr: I know how to generate random instances of data types in a generic way, and even have some old code that already does all the hard work, but won’t have time … Continue reading

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

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

QuickCheck rocks my socks

Over the past few days I’ve been hacking on a Data.List.Split module, to be used when you just want to quickly split up a list without going to the trouble of using a real parsing or regular expression library — … Continue reading

Posted in haskell, projects | Tagged , | 2 Comments