The code from _Monads & Gonads_.