The computation appendFilefile 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.
main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])
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.