package rea

  1. Overview
  2. Docs

An abstraction for accessing instance variables or properties of objects.

type 'a t

Represents an updatable instance variable or property of an object.

val make : (unit -> 'a) -> ('a -> unit) -> 'a t

make get set specifies a property from get and set.

val get : (< .. > as 'o -> 'a t) -> 'o -> 'a

get prop_of obj gets the property.

val set : (< .. > as 'o -> 'a t) -> 'a -> 'o -> 'o

set prop_of v obj functionally updates the property.

val map : (< .. > as 'o -> 'a t) -> ('a -> 'a) -> 'o -> 'o

map prop_of fn obj functionally updates the property.

OCaml

Innovation. Community. Security.