Tag Archives: enumeration

Lightweight invertible enumerations in Haskell

In a previous post I introduced a new Haskell library for enumerations (now on Hackage as simple-enumeration). The Data.Enumeration module defines a type Enumeration a, represented simply by a function Integer -> a which picks out the value of type … Continue reading

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

Lightweight, efficiently sampleable enumerations in Haskell

For another project I’m working on, I needed a way to enumerate and randomly sample values from various potentially infinite collections. There are plenty of packages in this space, but none of them quite fit my needs: universe (and related … Continue reading

Posted in combinatorics, haskell, projects | Tagged , , , , | 9 Comments

Adventures in enumerating balanced brackets

Since I’ve been coaching my school’s ACM ICPC programming team, I’ve been spending a bit of time solving programming contest problems, partly to stay sharp and be able to coach them better, but also just for fun. I recently solved … Continue reading

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

Higher-dimensional enumeration

The other day in the #haskell IRC channel, some of us were playing around with generalizing Haskell list enumeration syntax: Prelude> [1..5] [1,2,3,4,5] First, we defined the (…) operator to perform enumeration, so it can be partially applied. (Unfortunately, we … Continue reading

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