Skip to content

Commit

Permalink
Rename Lwd.map_and_set -> Lwd.update
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierNicole committed Nov 20, 2023
1 parent 8b66c0b commit 99bb0ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lwd/lwd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ let peek = function
| Operator ({desc = Var v; _}) -> v.binding
| _ -> assert false

let map_and_set f v = set v (f (peek v))
let update f v = set v (f (peek v))

(* Primitives *)
type 'a prim = 'a t
Expand Down
2 changes: 1 addition & 1 deletion lib/lwd/lwd.mli
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ val peek : 'a var -> 'a
(** Observe the current value of the variable, without any dependency
tracking. *)

val map_and_set : ('a -> 'a) -> 'a var -> unit
val update : ('a -> 'a) -> 'a var -> unit
(** Modify a variable based on its currently observed value. *)

type +'a prim
Expand Down

0 comments on commit 99bb0ba

Please sign in to comment.