Barefaced pilferage of monadic bind

I had an insightful discussion on haskell-cafe on how to steal the implementation of monadic bind from a continuation monad transformer.

I did it twice, first re-inventing the two-continuation model for depth-first search, then discovering an implementation of breadth-first search that I didn’t know before.

On the go, I used higher-rank infix record selectors for the first time.

In this program I talk about monads for non-determinism, functional lists, continuations, and what you get for free when you combine them.

Faster Non-deterministic programs with explicit parallelism

What does this chart mean?

yellow bars

find out!

Fair conjunction and disjunction

How can you write a Haskell predicate that detects (without diverging) that both of these two infinite trees are unsorted?


Using SmallCheck to Shatter an Audacious Claim

Today I played with SmallCheck. Interested in what happened when I tried to find a small unsatisfiable boolean formula that is not easily detected as such? Watch my attempts! (strip .html suffix for executable Haskell file)


Fun with Infinite Global Constants

I just wrote a tiny little Haskell program that demonstrates a small trick: how to use an infinite global constant to speed up tree-recursive functions. Remove .html from it’s URL to download an executable Haskell file.

comments on reddit


Monadic and Queue-Based Tree Search

Insipred by Monadic Conctraint Programming by Tom Schrijvers et. al., I wrapped up some thoughts on the difference between monadic and queue-based tree search.


Haskell idioms I did not understand before hacking them on my own

When coding my first library for Hackage, I learned about two programming problems and their solutions in Haskell. I boiled them down to the essence and wrote two posts to share them. One on polyvariadic functions, the other on heterogeneous collections. To get an executable Haskell file simply strip off the .html suffix.