Anonymous user
Reverse the order of lines in a text file while preserving the contents of each line: Difference between revisions
Reverse the order of lines in a text file while preserving the contents of each line (view source)
Revision as of 20:51, 7 August 2022
, 1 year agoInitial Haskell version.
(→Pascal: move contents to →Free Pascal: and provide ISO-compliant source code, create →Delphi: referencing →Free Pascal) |
(Initial Haskell version.) |
||
Line 347:
saying 'Nice Doggy'
"Diplomacy is the art of
</pre>
=={{header|Haskell}}==
<lang haskell>import qualified Data.Text as T
import qualified Data.Text.IO as TIO
main :: IO ()
main = TIO.interact $ T.unlines . reverse . T.lines</lang>
{{out}}
<pre>
$ tac < tac.in
--- Will Rodgers
until you can find a rock."
saying 'Nice Doggy'
"Diplomacy is the art of
</pre>
|