Language
Semantic Collections
Augur's most genuinely useful feature: collection operations whose criterion is natural language, resolved by the oracle.
| Operation | Syntax | Oracle? |
|---|---|---|
sort | sort xs [by "criterion"] | divined (native in certain) |
filter | filter xs by "predicate" | divined |
map | map xs with "transform" | divined |
pick | pick xs [by "criterion"] | divined (first in certain) |
classify | classify xs into ["a","b"] | divined |
extract | extract "what" from x | divined |
count | count x | native |
sum | sum xs | native |
reverse | reverse x | native |
unique | unique xs | native |
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"