memorize-monad
wikipedia example