Lemma.ShowData (lemma_engine v0.9.3)

Copy Markdown View Source

One input declared in a spec, as returned in Lemma.Show.data.

type is the raw LemmaType JSON map, a Rust discriminated union tagged by its "kind" string. It is intentionally left untyped here: pattern-match on it directly (e.g. %{"kind" => "measure", "units" => units} = entry.type) rather than routing through a parallel Elixir struct hierarchy for 12 type kinds.

Summary

Functions

Builds a Lemma.ShowData from one value of the decoded Lemma.show/4 JSON "data" map. prefilled/suggestion are absent (not null) from the API JSON when unset; Map.get/3 yields nil for both.

Types

t()

@type t() :: %Lemma.ShowData{
  needed_by_rules: [String.t()],
  prefilled: map() | nil,
  suggestion: map() | nil,
  type: map()
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Builds a Lemma.ShowData from one value of the decoded Lemma.show/4 JSON "data" map. prefilled/suggestion are absent (not null) from the API JSON when unset; Map.get/3 yields nil for both.