Module Ecaml__.Advice

val around_values : Ecaml.Symbol.t -> Core_kernel.Source_code_position.t -> (Ecaml__.Import.Value.t'a) Ecaml.Sync_or_async.t -> ?⁠docstring:string -> for_function:Ecaml.Symbol.t -> ?⁠interactive:Ecaml.Defun.Interactive.t -> ?⁠should_profile:bool -> ((Ecaml__.Import.Value.t list -> Ecaml__.Import.Value.t) -> Ecaml__.Import.Value.t list -> 'a) -> unit

around_values ?docstring ?interactive here return_type advice_name f ~for_function defines function advice_name with body f and adds it as advice on for_function.

Compared to around_funcall, around_values provides looser coupling when the advice doesn't need to interact with the arguments or return value of for_function.

module On_parse_error : sig ... end
val around_funcall : Ecaml.Symbol.t -> Core_kernel.Source_code_position.t -> ?⁠docstring:string -> for_function:Ecaml.Symbol.t -> ?⁠interactive:Ecaml.Defun.Interactive.t -> ?⁠on_parse_error:On_parse_error.t -> ?⁠should_profile:bool -> 'a Ecaml__.Import.Funcall.t -> ('a -> 'a) -> unit

around_funcall provides typeful access to the arguments and return value of for_function.

val add_predefined_function : Ecaml.Symbol.t -> for_function:Ecaml.Symbol.t -> unit

(describe-function 'advice-add)

val remove : Ecaml.Symbol.t -> for_function:Ecaml.Symbol.t -> unit

(describe-function 'advice-remove)