···47474848 let of' ranges =
4949 Jv.call range_set "of" [| Jv.of_array Range.to_jv ranges |] |> of_jv
5050-5151- let empty = Jv.get range_set "empty" |> of_jv
5252- let map t changes = Jv.call t "map" [| changes |] |> of_jv
5350end
-2
src/decoration.mli
···2626 include Jv.CONV with type t := t
27272828 val of' : Range.t array -> t
2929- val empty : t
3030- val map : t -> Jv.t -> t
3129end
-9
src/state_effect.ml
···11-type t = Jv.t
22-33-include (Jv.Id : Jv.CONV with type t := t)
44-55-let state_effect = Jv.get Jv.global "__CM__StateEffect"
66-let define () = Jv.call state_effect "define" [||]
77-let of_ t v = Jv.call t "of" [| v |]
88-let is instance t = Jv.to_bool (Jv.call instance "is" [| t |])
99-let value instance = Jv.get instance "value"
-17
src/state_effect.mli
···11-type t
22-(** An effect type definition, created with {!define}. *)
33-44-include Jv.CONV with type t := t
55-66-val define : unit -> t
77-(** [define ()] creates a new effect type. *)
88-99-val of_ : t -> Jv.t -> Jv.t
1010-(** [of_ effect_type value] creates an effect instance carrying [value]. *)
1111-1212-val is : Jv.t -> t -> bool
1313-(** [is instance effect_type] returns [true] if [instance] was created from
1414- [effect_type]. *)
1515-1616-val value : Jv.t -> Jv.t
1717-(** [value instance] returns the value carried by an effect instance. *)
···11-val define :
22- create:(unit -> Jv.t) ->
33- update:(Jv.t -> Jv.t -> Jv.t) ->
44- provide:(Jv.t -> Extension.t) ->
55- Extension.t
66-(** [define ~create ~update ~provide] creates a state field extension.
77-88- - [create ()] returns the initial field value.
99- - [update value transaction] computes the new value for each transaction.
1010- - [provide field] returns an extension that derives a facet from the field
1111- (e.g. [EditorView.decorations.from(field)]). *)