Up

module Macro

: sig
#
type 'a conv = [
| `Result of 'a
| `Error of exn * Sexp.t
]
#
type 'a annot_conv = ([
| `Result of 'a
| `Error of exn * Sexp.Annotated.t
] as 'body) constraint 'body = 'a Sexp.Annotated.conv
#
val load_sexp : string -> Sexp.t

load_sexp file like {!Sexp.load_sexp} file, but resolves the macros contained in file.

#
val load_sexps : string -> Sexp.t list

load_sexps file like {!Sexp.load_sexps} file, but resolves the macros contained in file.

#
val load_sexp_conv : string -> (Sexp.t -> 'a) -> 'a annot_conv

load_sexp_conv file f uses load_sexp and converts the result using f.

#
val load_sexps_conv : string -> (Sexp.t -> 'a) -> 'a annot_conv list

load_sexps_conv file f uses load_sexps and converts the result using f.

#
val load_sexp_conv_exn : string -> (Sexp.t -> 'a) -> 'a

load_sexp_conv_exn file f like load_sexp_conv, but raises an exception in case of conversion error.

#
val load_sexps_conv_exn : string -> (Sexp.t -> 'a) -> 'a list

load_sexps_conv_exn file f like load_sexps_conv, but raises an exception in case of conversion error.

#
val expand_local_macros : Sexp.t list -> Sexp.t list conv

expand_local_macros sexps takes a list of sexps and performs macro-expansion on them, except that an error will be returned if an :include macro is found.

#
module type Sexp_loader = sig

A version of load_sexps that is functorized with respect to the functions that load the sexps from files and the corresponding monad.

#
module Monad : sig
#
type 'a t
#
val return : 'a -> 'a t
#
module Monad_infix : sig
#
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
end
#
module List : sig
#
val iter : 'a list -> f:('a -> unit t) -> unit t
#
val map : 'a list -> f:('a -> 'b t) -> 'b list t
end
end
#
val load_sexps : string -> Sexp.t list Monad.t
#
val load_annotated_sexps : string -> Sexp.Annotated.t list Monad.t
end
#
module Loader : functor (S : Sexp_loader) -> sig
#
val load_sexp_conv : string -> (Sexp.t -> 'a) -> 'a annot_conv S.Monad.t
#
val load_sexps_conv : string -> (Sexp.t -> 'a) -> 'a annot_conv list S.Monad.t
end
#
val add_error_location : string -> exn -> exn
end