Utility library for monads, particularly those involving state