ocaml-batteries-team/batteries-included — pull request #501 by c-cube (2014-01-07 00:12:42+00:00)
Title: Monads everywhere

Ok, now this is a bigger PR than usual. It adds monad instances to `batSeq`, `batList` and `batLazyList`, adds a `BatInterfaces.Traversable` module signature that looks like

````ocaml
module type Traversable = sig
type 'a t (* container *)

type 'a m (* monad *)

val mapM : ('a -> 'b m) -> 'a t -> 'b t m

val foldM : ('a -> 'b -> 'a m) -> 'a -> 'b t -> 'a m

val sequence : 'a m t -> 'a t m
end
````

and functors `Traversable` that take a `BatInterfaces.Monad` and return a traversable for this monad and container, to aforementioned modules as well as `BatEnum`. For `BatEnum`, a similar `WithMonad` functor was already present so I modified it, but didn't rename it to preserve backward compatibility.