Module Funcall.Wrap

Wrap wraps an Elisp function as an OCaml function. Idiomatic use looks like:

  let not = Funcall.Wrap.("not" <: bool @-> return bool)
  let about_emacs = Funcall.Wrap.("about-emacs" <: nullary @-> return nil)
val return : 'a Value.Type.t -> 'a t
val nil : unit Value.Type.t
val nullary : unit Value.Type.t
val (<:) : string -> 'a t -> 'a
val (@->) : 'a Value.Type.t -> 'b t -> ('a -> 'b) t
include Value.Type.S
val create : Core.Sexp.t -> ('a -> Core.Sexp.t) -> (Value.t -> 'a) -> ('a -> Value.t) -> 'a Value.Type.t
val with_of_value_exn : 'a Value.Type.t -> (Value.t -> 'a) -> 'a Value.Type.t
val to_sexp : 'a Value.Type.t -> 'a -> Core.Sexp.t
val bool : bool Value.Type.t
val float : float Value.Type.t
val ignored : unit Value.Type.t
val int : int Value.Type.t
val string : string Value.Type.t

Represent an absolute time as a Lisp timestamp or Lisp time value.

(Info-goto-node "(elisp)Time of Day") for definitions.

Represent a span of time as a Lisp timestamp or Lisp time value.

This has the same Lisp representation as time_ns.

val string_cached : string Value.Type.t

string_cached is like string, except it uses of_utf8_bytes_cached.

val unit : unit Value.Type.t
val value : Value.t Value.Type.t
val list : 'a Value.Type.t -> 'a list Value.Type.t
val vector : 'a Value.Type.t -> 'a array Value.Type.t
val list_or_singleton : 'a Value.Type.t -> 'a list Value.Type.t

Represent a single-element list as an atom (not wrapped in a list), and a multi-element or empty list as a regular Lisp list.

val array_as_list : 'a Value.Type.t -> 'a array Value.Type.t

Represent an ocaml array as an elisp list, without creating an intermediate ocaml list.

val option : 'a Value.Type.t -> 'a option Value.Type.t

option represents None as nil and Some a as cons v nil, where v is the representation of a.

val nil_or : 'a Value.Type.t -> 'a option Value.Type.t

nil_or t represents None as nil and Some a as v, where v is the representation of a. This is a common representation used by Elisp functions. But it is only correct if nil is not a representation of any value in t; in that situation use Type.option.

val alist : 'a Value.Type.t -> 'b Value.Type.t -> ('a * 'b) list Value.Type.t
val tuple : 'a Value.Type.t -> 'b Value.Type.t -> ('a * 'b) Value.Type.t

Represent a tuple (a,b) as the elisp cons cell (a . b)

val tuple2_as_list : 'a Value.Type.t -> 'b Value.Type.t -> ('a * 'b) Value.Type.t

Represent a tuple (a,b) as the elisp list '(a b)

val tuple3_as_list : 'a Value.Type.t -> 'b Value.Type.t -> 'c Value.Type.t -> ('a * 'b * 'c) Value.Type.t

Represent a tuple (a,b,c) as the elisp list '(a b c)

val tuple4_as_list : 'a Value.Type.t -> 'b Value.Type.t -> 'c Value.Type.t -> 'd Value.Type.t -> ('a * 'b * 'c * 'd) Value.Type.t

Represent a tuple (a,b,c,d) as the elisp list '(a b c d)

val tuple5_as_list : 'a Value.Type.t -> 'b Value.Type.t -> 'c Value.Type.t -> 'd Value.Type.t -> 'e Value.Type.t -> ('a * 'b * 'c * 'd * 'e) Value.Type.t

Represent a tuple (a,b,c,d,e) as the elisp list '(a b c d e)

val sexpable : (module Core.Sexpable with type t = 'a) -> name:Core.Sexp.t -> 'a Value.Type.t

Embed a sexpable ocaml type, so we can save values of the type in emacs, e.g. as buffer local variables

val path_list : string list Value.Type.t

A list of directories. Each element is a string (directory name) or nil (try default-directory). nil values are converted to "." in OCaml, which has the same meaning.