update refc/buffer to check how many bytes have been read

This commit is contained in:
octeep 2022-01-21 17:44:58 +00:00 committed by G. Allais
parent 35a84e505d
commit f137d96cd6
2 changed files with 4 additions and 1 deletions

View File

@ -88,6 +88,8 @@
* Deprecates `base`'s `Data.Nat.Order.decideLTE` in favor of `Data.Nat.isLTE`.
* Removes `base`'s deprecated `System.Directory.dirEntry`. Use `nextDirEntry` instead.
* Removes `base`'s deprecated `Data.String.fastAppend`. Use `fastConcat` instead.
* `System.File.Buffer.readBufferData` now returns the number of bytes that have
been read into the buffer.
#### Contrib

View File

@ -38,7 +38,8 @@ main = do
| Nothing => pure ()
Right f <- openFile "testRead.buf" Read
| Left err => put $ pure err
Right ok <- readBufferData f readBuf 0 8
Right 8 <- readBufferData f readBuf 0 8
| Right size => put $ pure "\{show size} bytes have been read, 8 expected"
| Left err => put $ pure err
put $ bufferData readBuf