sophia/priv/stdlib/ListInternal.aes
2019-08-27 11:33:43 +02:00

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)