Module Ecaml__Defun

include Ecaml__.Defun_intf.Defun
type 'a t
val sexp_of_t : ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a t -> Ppx_sexp_conv_lib.Sexp.t
module Open_on_rhs_intf : sig ... end
include Core_kernel.Applicative.Let_syntax with type 'a t := 'a t with module Open_on_rhs_intf := Open_on_rhs_intf
type 'a t
module Open_on_rhs_intf : sig ... end
module Let_syntax : sig ... end
include Open_on_rhs_intf.S with type 'a S.t := 'a t
type 'a t = '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 required : string -> 'a Ecaml__.Import.Value.Type.t -> 'a t
val optional : string -> 'a Ecaml__.Import.Value.Type.t -> 'a option t
val rest : string -> 'a Ecaml__.Import.Value.Type.t -> 'a list t
val optional_with_default : string -> 'a -> 'a Ecaml__.Import.Value.Type.t -> 'a t
val optional_with_nil : string -> 'a Ecaml__.Import.Value.Type.t -> 'a t

An optional argument whose Value.Type.t handles nil directly.

include Ecaml__.Import.Value.Type.S
type value
type 'a t
val create : Core_kernel.Sexp.t -> ('a -> Core_kernel.Sexp.t) -> (value -> 'a) -> ('a -> value) -> 'a t
val with_of_value_exn : 'a t -> (value -> 'a) -> 'a t
val to_sexp : 'a t -> 'a -> Core_kernel.Sexp.t
val bool : bool t
val float : float t
val ignored : unit t
val int : int t
val string : string t
val string_cached : string t

string_cached is like string, except it uses of_utf8_bytes_cached.

val unit : unit t
val value : value t
val list : 'a t -> 'a list t
val vector : 'a t -> 'a array t
val array_as_list : 'a t -> 'a array t

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

val option : 'a t -> 'a option t

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

val nil_or : 'a t -> 'a option 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 t -> 'b t -> ('a * 'b) list t
val tuple : 'a t -> 'b t -> ('a * 'b) t

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

val tuple2_as_list : 'a t -> 'b t -> ('a * 'b) 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 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 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 Interactive : sig ... end
module For_testing : sig ... end
module Returns : sig ... end

An Returns.t states the return type of a function and whether the function returns a value of that type directly or via a Deferred.t. An (a, a) Returns.t means that the function returns a directly. An (a, a Deferred.t) Returns.t means that the function returns a via an a Deferred.t.

type 'a defun := Ecaml.Symbol.t -> Core_kernel.Source_code_position.t -> ?⁠docstring:string -> ?⁠define_keys:(Ecaml.Keymap.t * string) list -> ?⁠obsoletes:Ecaml.Symbol.t -> ?⁠should_profile:bool -> ?⁠interactive:Interactive.t -> ?⁠evil_config:Ecaml.Evil.Config.t -> 'a
val defun : ((_'a) Returns.t -> 'a t -> unit) defun
val defun_nullary : ((_'a) Returns.t -> (unit -> 'a) -> unit) defun
val defun_nullary_nil : ((unit -> unit) -> unit) defun
val defalias : Ecaml.Symbol.t -> Core_kernel.Source_code_position.t -> ?⁠docstring:string -> alias_of:Ecaml.Symbol.t -> unit -> unit

(describe-function 'defalias) (Info-goto-node "(elisp)Defining Functions")

val define_obsolete_alias : Ecaml.Symbol.t -> Core_kernel.Source_code_position.t -> ?⁠docstring:string -> alias_of:Ecaml.Symbol.t -> since:string -> unit -> unit

(describe-function 'define-obsolete-function-alias)

N.B. Load order matters. A subsequent defun will override the aliasing.

val lambda : Core_kernel.Source_code_position.t -> ?⁠docstring:string -> ?⁠interactive:Interactive.t -> (_'a) Returns.t -> 'a t -> Ecaml__.Import.Function.t
val lambda_nullary : Core_kernel.Source_code_position.t -> ?⁠docstring:string -> ?⁠interactive:Interactive.t -> (_'a) Returns.t -> (unit -> 'a) -> Ecaml__.Import.Function.t
val lambda_nullary_nil : Core_kernel.Source_code_position.t -> ?⁠docstring:string -> ?⁠interactive:Interactive.t -> (unit -> unit) -> Ecaml__.Import.Function.t