Implementing monads in untyped languages