Difference between revisions of "Unix tools/yes"
Jump to navigation
Jump to search
m (Various minor changes) |
m (Various minor changes) |
(No difference)
|
Latest revision as of 03:24, 26 April 2021
yes
A simple utility to repeatedly print "y"
to standard output.
Here are some various ways this small program can be written:
main = let y = putStrLn "y" >> y in y
|
main = putStrLn $ concat $ repeat "y\n"
|
main = let y = 'y' : '\n' : y in putStrLn y
|
main = putStrLn "y" >> main
|
main = putStrLn $ cycle "y\n"
|