10 lines
253 B
Plaintext
10 lines
253 B
Plaintext
namespace ListInternal =
|
|
|
|
// -- Flatmap ----------------------------------------------------------------
|
|
|
|
function flat_map(f : 'a => list('b), xs : list('a)) : list('b) =
|
|
switch(xs)
|
|
[] => []
|
|
x :: xs => f(x) ++ flat_map(f, xs)
|
|
|