fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 189: Filter and transform list
Idiom # 189: Filter and transform list
See
programming-idioms.org
:
Code
y := x.filter P .map T
What are effects?
Running Example
ex189 is x := 0.. # all non-negative integers P i32 -> bool := i -> i %% 3 # divisible by 3 T i32 -> String := i -> "{i}² = {i*i}" y := x.filter P .map T say y # alternatively, we can use `infix &` instead of `filter` and # `infix |` instead of `map` y1 := x & P | T say y1
What are effects?
last changed: 2024-07-01
next: NYI: Idiom # 190: Call an external C function