This paper describes how the concept of monads was used to implement CMTJava, a Domains Specific Language (DSL) for composable memory transactions in Java. Furthermore, the paper also proposes DCMTJava, a DSL that supports transactions using distributed objects.