package elpi

  1. Overview
  2. Docs
type 'a component

'a MUST be purely functional, i.e. backtracking is implemented by using * an old binding for 'a. * This limitation can be lifted if there is user request.

type ('a, 'b) source =
  1. | CompilerState of 'b Compile.State.component * 'b -> 'a
  2. | Other of unit -> 'a

The initial value of the constraint can be produced at compilation * time (e.g. by quotations) or by reading a global value.

val declare : name:string -> pp:(Format.formatter -> 'a -> unit) -> init:('a, 'b) source -> 'a component
val get : 'a component -> t -> 'a
val set : 'a component -> t -> 'a -> t

Allowed to raise BuiltInPredicate.No_clause

val update : 'a component -> t -> ('a -> 'a) -> t
val update_return : 'a component -> t -> ('a -> 'a * 'b) -> t * 'b
OCaml

Innovation. Community. Security.