package links

  1. Overview
  2. Docs
include module type of struct include Phrase end
module Value : sig ... end
type t =
  1. | Constant of Value.t
  2. | Var of Alias.t
  3. | InfixAppl of Operators.Binary.t * t * t
  4. | UnaryAppl of Operators.Unary.t * t
  5. | In of string list * Value.t list list
  6. | Case of t option * (t * t) list * t
  7. | TupleLit of t list
val pp : Ppx_deriving_runtime.Format.formatter -> t -> Ppx_deriving_runtime.unit
val show : t -> Ppx_deriving_runtime.string
include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
val var : string -> t

Create a variable phrase.

val infix : Operators.Binary.t -> t -> t -> t

Any infix operator application.

val and' : t -> t -> t

Create a logical and between two phrases.

val or' : t -> t -> t

Create a logical or between two phrases.

val equal : t -> t -> t

Create an equality comparison of two phrases.

val not' : t -> t

Logical not of a phrase.

val tuple : t list -> t

Create a tuple of a list of phrases.

val tuple_singleton : t -> t

Create a tuple of a single phrase.

val traverse : t -> f:(t -> t) -> t

Traverse a lens phrase, applying dosth to each nod and then replacing the result.

val get_vars : t -> Alias.Set.t

Get a list of variables in the expression.

val eval : t -> (string -> Value.t) -> Value.t

Calculate the value of an expression given a lookup function for variables.

val partial_eval : t -> lookup:(string -> Value.t option) -> t

Tries to execute and simplify as much of the equation as possible using the given variables.

val rename_var : t -> replace:string Alias.Map.t -> t

Rename all variables with an entry in the given map.

val replace_var : t -> replace:Value.t Alias.Map.t -> t

Replace all variable nodes with nodes by the given map.

val of_sugar : ('a * 'a Links_lens__.Phrase_sugar.t) -> t
module Constant : sig ... end
module Option : sig ... end
module List : sig ... end
module Record : sig ... end
module O : sig ... end

This module contains operators and short hand constructors for producing phrase expressions.

module Grouped_variables : sig ... end

This module is a simple algorithm for determining which variables affect each other during execution.

module Sugar : sig ... end
module Type : sig ... end
module Typesugar : sig ... end
OCaml

Innovation. Community. Security.