Skip to content

Commit

Permalink
Merge pull request #42 from mheinzel/mheinzel/fix-haddock
Browse files Browse the repository at this point in the history
Fix broken Haddock
  • Loading branch information
jorisdral authored Feb 12, 2024
2 parents a6f51ab + 3e9bf97 commit c3b9161
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions fs-api/src/System/FS/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ data HasFS m h = HasFS {
-- will always return at least 1 byte, as returning 0 bytes would mean
-- that we have reached EOF.
--
-- Postcondition: the length of the returned bytestring <= @n@ and >= 0.
-- Postcondition: for the length of the returned bytestring @bs@ we have
-- @length bs >= 0@ and @length bs <= n@.
, hGetSome :: HasCallStack => Handle h -> Word64 -> m BS.ByteString

-- | Same as 'hGetSome', but does not affect the file offset. An additional argument
Expand All @@ -89,8 +90,8 @@ data HasFS m h = HasFS {
--
-- If nothing can be written at all, an exception will be thrown.
--
-- Postcondition: the return value <= @l@ and > 0, unless the given
-- bytestring is empty, in which case the return value can be 0.
-- Postcondition: the return value @n@ is @n > 0@ and @n <= l@, unless the
-- given bytestring is empty, in which case @n@ can be 0.
, hPutSome :: HasCallStack => Handle h -> BS.ByteString -> m Word64

-- | Truncate the file to the specified size
Expand Down
6 changes: 3 additions & 3 deletions fs-api/src/System/FS/API/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ import Util.Condense
Modes
-------------------------------------------------------------------------------}

-- | How to 'hOpen' a new file.
-- | How to 'System.FS.API.hOpen' a new file.
data OpenMode
= ReadMode
| WriteMode AllowExisting
| AppendMode AllowExisting
| ReadWriteMode AllowExisting
deriving (Eq, Show)

-- | When 'hOpen'ing a file:
-- | When opening a file:
data AllowExisting
= AllowExisting
-- ^ The file may already exist. If it does, it is reopened. If it
Expand Down Expand Up @@ -299,7 +299,7 @@ ioToFsError fep ioErr = FsError
--
-- Note that we don't always use the classification made by
-- 'Foreign.C.Error.errnoToIOError' (also see 'System.IO.Error') because it
-- combines some errors into one 'IOErrorType', e.g., @EMFILE@ (too many open
-- combines some errors into one 'IO.IOErrorType', e.g., @EMFILE@ (too many open
-- files) and @ENOSPC@ (no space left on device) both result in
-- 'ResourceExhausted' while we want to keep them separate. For this reason,
-- we do a classification of our own based on the @errno@ while sometimes
Expand Down

0 comments on commit c3b9161

Please sign in to comment.