Renderingen-US

Experimental through version 1. Version 0 was alpha. This is the first language release: the interface is relatively stable, not frozen. Nothing is promised stable until version 2.

mean-sugar

Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.

Syntax:

Category#

collection

None.

Examples#

radix/corpus/summa/mean-sugar.fab (canonical · concept)#

main {
    let list<f32> flat ← [3.0, 1.0, 3.0, 2.0]
    let tf32[4] a ← flat ↦ tf32[4]
    let f32 viaSum ← (reduce via sum from a) / 4.0
    print a.mean()
    print viaSum
    let list<f32> emptyData ← []
    let tf32[0] e ← emptyData ↦ tf32[0]
    print e.mean()
}

Expected output:

2.25
2.25
NaN