phonetic-languages-simplified-base-0.9.0.0: A basics of the phonetic-languages functionality that can be groupped.
Copyright(c) Oleksandr Zhabenko 2021-2024
LicenseMIT
Maintaineroleksandr.zhabenko@yahoo.com
StabilityExperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010
Extensions
  • ScopedTypeVariables
  • ExplicitForAll

Data.ChooseLine

Description

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.

Synopsis

Documentation

compareFilesToOneCommon Source #

Arguments

:: 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.

toFileStr Source #

Arguments

:: FilePath

The FilePath to the file to be written in the AppendMode (actually appended with) the information output.

-> [String]

Each element is appended on the new line to the file.

-> IO () 

Prints list of Strings to the file as a multiline String with default line ending. Uses appendFile function inside.