Incorrect function in 9.4 Uniqueness and Sharing
There are two problems with the AppendAorB
function as depicted in chapter 9.4 of the 3.0 documentation. First, the returntype of freadc
does not match the one in StdFile
. Secondly, after changing the function to:
AppendAorB:: *File -> *File
AppendAorB file
| fc == 'a' = fwritec 'a' file
= fwritec 'b' file
where
(_, fc,nf) = freadc file
It still produces the error the surrounding texts seems to imply should not be produced.
Edited by Erin van der Veen