View Source Guesswork.Ast.Is (Guesswork v0.8.0)
Binds a variable or entity to a function (constraint). If a variable is used, the constraint is used to figure out its value. If an entity is used, the constraint is used to test validity.
Note that, if all the inputs
are concrete, the computation for is can be
resolved before Guesswork.Answer.Result.run/2
is called.
Summary
Functions
Builds a new constraint.
Types
@type opts_list() :: [{:halt_on_error, term()}]
@type t() :: %Guesswork.Ast.Is{ binding: Guesswork.Ast.Entity.t() | Guesswork.Ast.Variable.t(), func: Guesswork.Answer.Computation.func(), halt_on_error: boolean(), inputs: [Guesswork.Ast.Entity.t() | Guesswork.Ast.Variable.t()] }
Functions
@spec new( Guesswork.Ast.Variable.t() | Guesswork.Ast.Entity.t(), [Guesswork.Ast.Variable.t() | Guesswork.Ast.Entity.t()], Guesswork.Answer.Computation.func(), opts_list() ) :: t()
Builds a new constraint.
The following fields are available: