module GapiLens:sig..end
Based on F# implementation in FSharpx
(see src/FSharpx.Core/Lens.fs for the original implementation)
See also
type ('a, 'b) t = {
|
get : |
(* |
Functional getter
| *) |
|
set : |
(* |
Functional setter
| *) |
val modify : ('a, 'b) t -> ('b -> 'b) -> 'a -> 'aval compose : ('a, 'b) t -> ('c, 'a) t -> ('c, 'b) tval pair : ('a, 'b) t -> ('c, 'd) t -> ('a * 'c, 'b * 'd) tval cond : ('a -> bool) ->
('a, 'b) t -> ('a, 'b) t -> ('a, 'b) t
cond pred lensTrue lensFalse: pred is applied to source. If true, lensTrue is selected. If false, lensFalse is selected.
val get_state : ('a, 'b) t -> 'a -> 'b * 'aval put_state : ('a, 'b) t -> 'b -> 'a -> unit * 'aval modify_state : ('a, 'b) t -> ('b -> 'b) -> 'a -> unit * 'aval ignore : ('a, unit) tval id : ('a, 'a) tval first : ('a * 'b, 'a) tval second : ('a * 'b, 'b) tval head : ('a list, 'a) tval tail : ('a list, 'a list) tval for_hash : 'a -> (('a, 'b) Hashtbl.t, 'b option) tval for_assoc : 'a -> (('a * 'b) list, 'b option) tval for_array : int -> ('a array, 'a) tval for_list : int -> ('a list, 'a) tval option_get : ('a option, 'a) tval list_map : ('a, 'b) t -> ('a list, 'b list) tval xmap : ('a -> 'b) -> ('b -> 'a) -> ('c, 'a) t -> ('c, 'b) tmodule Infix:sig..end
module StateInfix:sig..end