package links

  1. Overview
  2. Docs
include module type of struct include Links_lens.Phrase end
type t = Links_lens.Phrase.t =
  1. | Constant of Value.t
  2. | Var of Links_lens.Alias.t
  3. | InfixAppl of Links_lens.Operators.Binary.t * t * t
  4. | UnaryAppl of Links_lens.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
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 : Links_lens.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 lt : t -> t -> t

Less than 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 -> Links_lens.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 Links_lens.Alias.Map.t -> t

Rename all variables with an entry in the given map.

val replace_var : t -> replace:Value.t Links_lens.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 = Links_lens.Phrase.Constant
module Option = Links_lens.Phrase.Option
module Record = Links_lens.Phrase.Record

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

module Grouped_variables = Links_lens.Phrase.Grouped_variables

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.