elpi

ELPI - Embeddable λProlog Interpreter
Library elpi
Module Elpi . API . State
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.

val declare : name:string -> pp:( Format.formatter -> 'a -> unit ) -> init:( unit -> 'a ) -> start:( 'a -> 'a ) -> 'a component
type t = Data.state
val get : 'a component -> t -> 'a
val set : 'a component -> t -> 'a -> t
val update : 'a component -> t -> ( 'a -> 'a ) -> t

Allowed to raise BuiltInPredicate.No_clause

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