package travesty

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Basic_generic describes bi-mapping on any arity of type.

  • For arity-0 types, use S0: ('l, 'r) t becomes t, 'l left becomes left, and 'r right becomes right.
  • For arity-1 types with a fixed right type, use S1_left: ('l, 'r) t becomes 'l t, 'l left becomes 'l, and 'r right becomes right.
  • For arity-1 types with a fixed left type, use S1_right: ('l, 'r) t becomes 'l t, 'l left becomes left, and 'r right becomes 'r.
  • For arity-2 types, use S2: ('l, 'r) t becomes ('l, 'r) t, 'l left becomes 'l, and 'r right becomes 'r.
include Types_intf.Bi_generic
type ('l, 'r) t

Generic container type.

type 'l left

Generic left type.

type 'r right

Generic right type.

val bi_map : ('l1, 'r1) t -> left:('l1 left -> 'l2 left) -> right:('r1 right -> 'r2 right) -> ('l2, 'r2) t

bi_map c ~left ~right maps left over every 'l1 left, and right over every 'r1 right, in c.