Module Middle.Fun_kind

Types for function kinds, e.g. StanLib or UserDefined, and function suffix types, e.g. foo_ldfp, bar_lp

type 'propto suffix =
  1. | FnPlain
  2. | FnRng
  3. | FnLpdf of 'propto
  4. | FnLpmf of 'propto
  5. | FnTarget
  6. | FnJacobian
val fold_suffix : ('a -> 'b -> 'a) -> 'a -> 'b suffix -> 'a
val map_suffix : ('a -> 'b) -> 'a suffix -> 'b suffix
val compare_suffix : 'propto. ('propto -> 'propto -> int) -> 'propto suffix -> 'propto suffix -> int
val hash_fold_suffix : 'propto. (Ppx_hash_lib.Std.Hash.state -> 'propto -> Ppx_hash_lib.Std.Hash.state) -> Ppx_hash_lib.Std.Hash.state -> 'propto suffix -> Ppx_hash_lib.Std.Hash.state
val suffix_of_sexp : 'propto. (Sexplib0.Sexp.t -> 'propto) -> Sexplib0.Sexp.t -> 'propto suffix
val sexp_of_suffix : 'propto. ('propto -> Sexplib0.Sexp.t) -> 'propto suffix -> Sexplib0.Sexp.t
val equal_suffix : 'propto. ('propto -> 'propto -> bool) -> 'propto suffix -> 'propto suffix -> bool
val without_propto : bool suffix -> unit suffix
type 'e t =
  1. | StanLib of string * bool suffix * Mem_pattern.t
  2. | CompilerInternal of 'e Internal_fun.t
  3. | UserDefined of string * bool suffix
val map : ('a -> 'b) -> 'a t -> 'b t
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val compare : 'e. ('e -> 'e -> Core__.Import.int) -> 'e t -> 'e t -> Core__.Import.int
val t_of_sexp : 'e. (Sexplib0.Sexp.t -> 'e) -> Sexplib0.Sexp.t -> 'e t
val sexp_of_t : 'e. ('e -> Sexplib0.Sexp.t) -> 'e t -> Sexplib0.Sexp.t
val hash_fold_t : 'e. (Ppx_hash_lib.Std.Hash.state -> 'e -> Ppx_hash_lib.Std.Hash.state) -> Ppx_hash_lib.Std.Hash.state -> 'e t -> Ppx_hash_lib.Std.Hash.state
val jacobian_compat_mode : bool Core.ref

If true, we assume _jacobian functions are "plain" functions for the purposes of typechecking and warnings

val suffix_from_name : string -> bool suffix
val forget_normalization : 'a suffix -> unit suffix
val with_unnormalized_suffix : string -> string option
val pp : 'a Fmt.t -> Stdlib.Format.formatter -> 'a t -> unit
val collect_exprs : 'a t -> 'a list