Unix tools/yes

From HaskellWiki
< Unix tools
Revision as of 20:48, 19 December 2007 by Knome (talk | contribs)
Jump to navigation Jump to search

yes

A simple utility to repeatedly print y to standard out.

Here are some various ways this simple 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