Logo

Programming-Idioms

History of Idiom 256 > diff from v36 to v37

Edit summary for version 37 by kingsley_Huang:
[Haskell] note on printing out the result

Version 36

2023-03-24, 03:50:47

Version 37

2023-03-24, 03:51:55

Idiom #256 Count backwards

Print the numbers 5, 4, ..., 0 (included), one line per number.

Idiom #256 Count backwards

Print the numbers 5, 4, ..., 0 (included), one line per number.

Extra Keywords
countdown negative step reverse
Extra Keywords
countdown negative step reverse
Code
foldl  (\res x-> x:res) [] [0..5]
Code
foldl  (\res x-> x:res) [] [0..5]
Comments bubble
Note that this creates a reversed list (but only print it if you're in repl)