Logo

Programming-Idioms

History of Idiom 2 > diff from v107 to v108

Edit summary for version 108 by senfoel:
[Haskell] replicateM_ is located in Control.Monad

Version 107

2019-12-08, 20:14:28

Version 108

2020-01-06, 12:11:05

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration
Imports
Imports
import Control.Monad
Code
replicateM_ 10 $ putStrLn "Hello"
Code
replicateM_ 10 $ putStrLn "Hello"
Origin
http://stackoverflow.com/questions/16004365/simple-haskell-loop#answer-16004389
Origin
http://stackoverflow.com/questions/16004365/simple-haskell-loop#answer-16004389