Copyright | (c) Oleksandr Zhabenko 2021-2024 |
---|---|
License | MIT |
Maintainer | oleksandr.zhabenko@yahoo.com |
Stability | Experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Extensions |
|
General shared by phladiprelio-ukrainian-simple and phladiprelio-general-simple functionality to compare contents of the up to 14 files line-by-line and to choose the resulting option.
Documentation
compareFilesToOneCommon Source #
:: Int | A number of files to be read and treated as sources of lines to choose from. |
-> [FilePath] | |
-> FilePath | |
-> IO () |
Is rewritten from the https://hackage.haskell.org/package/phonetic-languages-simplified-examples-array-0.21.0.0/docs/src/Phonetic.Languages.Lines.html#compareFilesToOneCommon Given a list of different filepaths and the resulting filepath for the accumulated data provides a simple way to compare options of the lines in every file in the first argument and to choose that option for the resulting file. Therefore, the resulting file can combine options for lines from various sources.
readFileIfAny :: FilePath -> IO String Source #
Inspired by: 'https://hackage.haskell.org/package/base-4.15.0.0/docs/src/GHC-IO.html#catch'
Is taken from the
https:/hackage.haskell.orgpackagestring-interpreter-0.8.0.0docssrcInterpreter.StringConversion.html#readFileIfAny
to reduce general quantity of dependencies.
Reads a textual file given by its FilePath
and returns its contents lazily. If there is
some IOException
thrown or an empty file then returns just "". Raises an exception for the binary file.
:: FilePath | The |
-> [String] | Each element is appended on the new line to the file. |
-> IO () |
Prints list of String
s to the file as a multiline String
with default line ending. Uses appendFile
function inside.