Builtin Helpers
Several new builtin functions are proposed to address issues and inconsistencies.
Replacing _|_
(bottom):
error
to enable user defined messagesisconcrete
andexists
for testing or comparisons
Validators:
must(expr)
passes ifexpr
evaluates totrue
and fails otherwisenot(expr)
passes if unified with a valuex
for whichexpr&x
fails andfalse
otherwise.numexist(count, ...expr)
passes if the number of expressions for whichexists(x)
evaluates totrue
unifies withcount
.numconcrete(count, ...expr)
passes if the number of expressions for whichisconcrete(x)
evaluates totrue
unifies withcount
.numvalid(count, ...expr)
passes if the number of expressions for whichisvalid(x)
evaluates totrue
unifies withcount
.
Others:
manifest(x)
evaluatesx
stripping it of any optional fields and definitions and disambiguating disjunctions after their removal.range(from, to, by)
creates a stream of values like found in other languageshead([...])
returns the first element of a list- Package
std
would namespace all core builtins under thestd
package name.
You can find more details on GitHub issue: core builtin extensions