append package:base

A monomorphic version of <> for NonEmpty.
>>> append (1 :| []) (2 :| [3])
1 :| [2,3]
The computation appendFile file str function appends the string str, to the file file. Note that writeFile and appendFile write a literal string to a file. To write a value of any printable type, as with print, use the show function to convert the value to a string first. This operation may fail with the same errors as hPutStr and withFile.

Examples

The following example could be more efficently written by acquiring a handle instead with openFile and using the computations capable of writing to handles such as hPutStr.
>>> let fn = "hello_world"

>>> in writeFile fn "hello" >> appendFile fn " world!" >> (readFile fn >>= putStrLn)
"hello world!"
>>> let fn = "foo"; output = readFile' fn >>= putStrLn

>>> in output >> appendFile fn (show [1,2,3]) >> output
this is what's in the file
this is what's in the file[1,2,3]
Attach a list at the end of a NonEmpty.
>>> appendList (1 :| [2,3]) []
1 :| [2,3]
>>> appendList (1 :| [2,3]) [4,5]
1 :| [2,3,4,5]
Concatenation of type-level symbols.
An associative operation NOTE: This method is redundant and has the default implementation mappend = (<>) since base-4.11.0.0. Should it be implemented manually, since mappend is a synonym for (<>), it is expected that the two functions are defined the same way. In a future GHC release mappend will be removed from Monoid.
isAppendHandleType hdlType returns True if hdlType is AppendHandle.