package vcaml

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

A 'a Api_call.t is a thunked call to neovim returning a Msgpack-encoded 'a. No RPC traffic is generated until an Api_call.t is invoked via run or run_join.

Api_call.t's can be manipulated with an applicative-like interface.

A good mental model is that invoking a 'a Api_call.t should cause exactly one RPC message to be sent to the neovim client, and that any operations within will not be interrupted. Calls with side effects will occur in the order written, so

let%map _a = a
and _b = b
in
()

will cause Neovim to first run a and then b.

This is important for applications that rely on manipulating neovim's internal state. In particular, the atomicity guarantee prevents races with other pending operations, including user input.

You can run an Api_call.t with run or run_join.

include Core.Applicative.S with type 'a t = 'a Api_call.t
type 'a t
val return : 'a -> 'a t
val map : 'a t -> f:('a -> 'b) -> 'b t
val both : 'a t -> 'b t -> ('a * 'b) t
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

same as apply

val (<*) : 'a t -> unit t -> 'a t
val (*>) : unit t -> 'a t -> 'a t
val (>>|) : 'a t -> ('a -> 'b) -> 'b t
val apply : ('a -> 'b) t -> 'a t -> 'b t
val map2 : 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c t
val map3 : 'a t -> 'b t -> 'c t -> f:('a -> 'b -> 'c -> 'd) -> 'd t
val all : 'a t list -> 'a list t
val all_unit : unit t list -> unit t
module Applicative_infix : sig ... end
include Core.Applicative.Let_syntax with type 'a t := 'a Api_call.t
module Open_on_rhs_intf : sig ... end
module Let_syntax : sig ... end
module Or_error : sig ... end