Logo

Programming-Idioms

History of Idiom 256 > diff from v23 to v24

Edit summary for version 24 by Vaporox:
New Haskell implementation by user [Vaporox]

Version 23

2021-10-27, 17:21:08

Version 24

2021-11-11, 20:27:31

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
Imports
import Control.Monad (forM_)
Code
forM_ (reverse [0..5]) print
Comments bubble
This must be used in an IO context.
Doc URL
https://hackage.haskell.org/package/base-4.16.0.0/docs/Control-Monad.html#v:forM_