MattWindsor91 / travesty

Haskell-style container traversability and state monads for Core
https://MattWindsor91.github.io/travesty
MIT License
10 stars 1 forks source link

Feature idea: Bi_traversable #3

Closed MattWindsor91 closed 5 years ago

MattWindsor91 commented 5 years ago

Per Haskell.

This would have a similar setup to Bi_mappable inasmuch as having four arities (0, 1_left, 1_right, and 2, but would then follow Traversable for most of the structure; the generic basic input would be something like:

module On_monad (M : Monad.S) : sig
  val bi_map_m :
     ('l1, 'r1) t
  -> left:('l1 left -> 'l2 left M.t)
  -> right:('r1 right -> 'r2 right M.t)
  -> ('l2, 'r2) t M.t
end

We'd then have

MattWindsor91 commented 5 years ago

Implemented now.