fun for(low: int, high: int, f: int -> list<b>): list<b>
list(low, high).flatmap(f)
fun pure(a: a): list<a>
[a]
fun guard(a : bool, f: () -> list<a>): list<a>
if a then f() else []and now I can use them like this:
pub fun cuboid(layers: int, rows: int, cols: int): cuboid
val coords =
with layer <- for(0, layers)
with row <- for(0, rows)
with col <- for(0, cols)
pure((layer, row, col))
// ...