Kết xuấtvi

promissum

Translation status: Tiếng Việt reader-locale proof. Code fences render through the vi pipeline; prose is canonical Latin.

Promise-like result type associated with async finite functions.

Aliases: promise

Syntax: promissum<T> | promissum<T ⇥ E>

Category#

async

Examples#

radix/corpus/promissum/promissum.fab (canonical · keyword)#

Promise-like result type associated with async finite functions.

# =============================================================================
# promissum — Promise-like result type associated with async finite functions.
# =============================================================================
#
# What this teaches:
#   • Async return type — `promissum<T>` is the return-type wrapper for `fiet`
#     functions and compatibility `@ futura` functions.
#   • Failable async return type — `promissum<T ⇥ E>` preserves both the
#     resolved value and delayed alternate channel.
#
# Common mistakes:
#   • Creating a `promissum<T>` but never awaiting it with `figendum`,
#     `variandum`, `reddet`, or `tacebit` — the promise goes unobserved.
#
# See also: fiet, futura, figendum, tacebit
# =============================================================================

# promissum<T> — async result type (paired with fiet)
#
# functio … fiet → <typus>       -- lowers to promissum<<typus>>
# functio … fiet → <typus> ⇥ E   -- lowers to promissum<<typus> ⇥ E>
#
# GRAMMAR:
#   futuraDecl :← funcDecl 'fiet'
#
# EXPECTED OUTPUT:
#   promissum typus notus (promissum.expected).

fn compute() async  int {
    return 7
}

main {
    print "promissum typus notus"
}

Expected output:

promissum typus notus