Something went wrong. Try again.
Actually just three programming languages in a trenchcoat
Something went wrong. Try again.
450 B · 21 lines
12345678910111213141516171819202122type Helpers { func repeat 0 _ = unit func repeat n x = x : repeat (n - 1) x
func twice x = repeat 2 x func thrice x = repeat 3 x
proc printEach!(iterable) { for item in iterable { println!(item) } }
export twice, thrice, printEach}
proc main!() { let numbers = [1, 2, 3, 4, 5] Helpers::printEach!(map Helpers::twice numbers) Helpers::printEach!(map helpers::thrice numbers)}