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
functors Fix_left/Fix_right/Fix_both for moving down rarities:
functors Traverse_left/Traverse_right: Bi_traversable down to Traversable;
the signature of Bi_mappable.Sn included in Bi_traversable.Sn, allowing use of the usual Bi_mappable functors.
Per Haskell.
This would have a similar setup to
Bi_mappable
inasmuch as having four arities (0
,1_left
,1_right
, and2
, but would then followTraversable
for most of the structure; the generic basic input would be something like:We'd then have
Fix_left
/Fix_right
/Fix_both
for moving down rarities:Traverse_left
/Traverse_right
: Bi_traversable down to Traversable;Bi_mappable.Sn
included inBi_traversable.Sn
, allowing use of the usualBi_mappable
functors.