links

The Links Programming Language
IN THIS PACKAGE
Module Links_lens . Phrase
include module type of struct include Phrase end
module Value : sig ... end
type t =
| Constant of Value.t
| Var of Alias.t
| InfixAppl of Operators.Binary.t * t * t
| UnaryAppl of Operators.Unary.t * t
| In of string list * Value.t list list
| Case of t option * (t * t) list * t
| TupleLit of t list
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