package ecaml

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

A typeful interface for calling Elisp, as external does for C. E.g.,

let not : bool -> bool = "not" <: bool @-> return bool

let about_emacs : unit -> unit = "about-emacs" <: nullary @-> return nil
type 'a t
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

"foo" <: ty imports Elisp function whose name is "foo" and whose type is ty, like how foo :> ty types an OCaml value.

val (@->) : 'a Value.Type.t -> 'b t -> ('a -> 'b) t
include Value.Type.S
val create : Core_kernel.Sexp.t -> ('a -> Core_kernel.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_kernel.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
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 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 sexpable : (module Core_kernel.Sexpable with type t = 'a) -> name:Core_kernel.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 ".", which has the same meaning.

module Private : sig ... end
OCaml

Innovation. Community. Security.