View Source Guesswork.Answer.Result (Guesswork v0.7.0)

A module for evaluating and displaying query results.

Summary

Functions

Returns the event prefix used by run/2 to create a telemetry span.

Takes a query and attempts to resolve n answers from it.

Takes a value and produces a readable string.

Types

t()

@type t() :: %Guesswork.Answer.Result{
  answer_sets: [%{required(String.t()) => value()}]
}

value()

@type value() ::
  {:bound, Guesswork.Ast.Term.entity()}
  | {:not, [Guesswork.Ast.Term.entity()]}
  | {:constraints, [String.t()]}

Functions

event_prefix()

@spec event_prefix() :: [atom()]

Returns the event prefix used by run/2 to create a telemetry span.

run(query, n \\ 1)

@spec run(Guesswork.Query.t(), integer()) :: t()

Takes a query and attempts to resolve n answers from it.

value_to_string(arg)

@spec value_to_string(value()) :: String.t()

Takes a value and produces a readable string.