package travesty

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

Extensions2 describes various extensions of arity-1 mappable containers.

include Base.T2
type ('a, 'b) t
include Generic_extensions with type ('l, 'r) t := ('l, 'r) t and type 'l left := 'l and type 'r right := 'r
include Types_intf.Bi_generic with type ('l, 'r) t := ('l, 'r) t with type 'l left := 'l with type 'r right := 'r
val map_left : ('l1, 'r) t -> f:('l1 -> 'l2) -> ('l2, 'r) t

map_left c ~f maps f over the left type of c only.

val map_right : ('l, 'r1) t -> f:('r1 -> 'r2) -> ('l, 'r2) t

map_right c ~f maps f over the right type of c only.

To fix both types, use T.Fix_left(Left).Fix_right(right).

module Fix_left (Left : Base.T) : S1_right_with_extensions with type 'r t := (Left.t, 'r) t and type left := Left.t

Fixes the left type of this container to Left.t.

module Fix_right (Right : Base.T) : S1_left_with_extensions with type 'l t := ('l, Right.t) t and type right := Right.t

Fixes the right type of this container to Right.t.

OCaml

Innovation. Community. Security.