Augur docs

Language

Semantic Collections

Augur's most genuinely useful feature: collection operations whose criterion is natural language, resolved by the oracle.

OperationSyntaxOracle?
sortsort xs [by "criterion"]divined (native in certain)
filterfilter xs by "predicate"divined
mapmap xs with "transform"divined
pickpick xs [by "criterion"]divined (first in certain)
classifyclassify xs into ["a","b"]divined
extractextract "what" from xdivined
countcount xnative
sumsum xsnative
reversereverse xnative
uniqueunique xsnative
summon names   = ["ana", "joão", "  MARIA ", "pedro"]
summon cleaned = map names with "trim and title-case"
summon emails  = extract "only valid emails" from "contact: ana@x.com, junk, j@y.org"
summon urgent  = filter ["pay now", "hi", "URGENT: server down"] by "look urgent"
proclaim sort cleaned by "alphabetical order"

summon buckets = classify ["bug report", "thank you", "refund"] into ["complaint", "praise"]
proclaim count [1, 2, 3]          // 3 (native)
The four native ops never call the oracle. filter/map/classify/extract require the oracle and return an oracle value inside certain. sort and pick degrade gracefully in certain: a native comparison sort and the first element.

Parallelism (gather)

Element-wise collection ops call the oracle once per element, in order. For many independent calls that's slow — gather runs them concurrently instead, preserving input order.

summon facts = gather [
  divine "the capital of France",
  divine "the capital of Japan",
  divine "the capital of Brazil",
]

summon translated = gather map articles with "translate to English"