package travesty

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

Extensions for arity-1 bi-mappable containers with a floating left type.

include Types_intf.Bi_left
type 'l t

Partially fixed type of containers.

type right

Fixed type of right elements.

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

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

val map_right : 'l t -> f:(right -> right) -> 'l t

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

module Fix_left (Left : Base.T) : S0_with_extensions with type t := Left.t t and type left := Left.t

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

Bi-mappable types with a fixed right type are mappable over their left.

include Mappable.S1 with type 'l t := 'l t
include Mappable.Generic with type 'a t := 'a t and type 'a elt := 'a

Generic refers to the container type as 'a t, and the element type as 'a elt; substitute t/elt (arity-0) or 'a t/'a (arity-1) accordingly below.

include Types_intf.Generic with type 'a t := 'a t with type 'a elt := 'a
val map : 'a t -> f:('a -> 'b) -> 'b t

map c ~f maps f over every t in c.

OCaml

Innovation. Community. Security.