3 ms·
Yes. You can implement sequence/traverse/etc. for each specific monad in OCaml, but if you want to write a generic implementation that will work for any monad t
by lmm 11y ago
Yes. You can implement sequence/traverse/etc. for each specific monad in OCaml, but if you want to write a generic implementation that will work for any monad then you need typeclass-like functionality.
- nv-vn 11y agoNot necessarily. You can manually pass in the module for the monad using first-class modules and then define the functions in terms of that. You could also define those operations in terms of monads using a functor if you want it to look more like Haskell.