From 3e9bf970c319431d7cd31ec9d62cf32282154936 Mon Sep 17 00:00:00 2001 From: Matthias Heinzel Date: Mon, 12 Feb 2024 16:53:38 +0100 Subject: [PATCH] fix broken Haddock --- fs-api/src/System/FS/API.hs | 7 ++++--- fs-api/src/System/FS/API/Types.hs | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fs-api/src/System/FS/API.hs b/fs-api/src/System/FS/API.hs index fa08db8..806c39f 100644 --- a/fs-api/src/System/FS/API.hs +++ b/fs-api/src/System/FS/API.hs @@ -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 @@ -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 diff --git a/fs-api/src/System/FS/API/Types.hs b/fs-api/src/System/FS/API/Types.hs index 9422235..f53095e 100644 --- a/fs-api/src/System/FS/API/Types.hs +++ b/fs-api/src/System/FS/API/Types.hs @@ -66,7 +66,7 @@ import Util.Condense Modes -------------------------------------------------------------------------------} --- | How to 'hOpen' a new file. +-- | How to 'System.FS.API.hOpen' a new file. data OpenMode = ReadMode | WriteMode AllowExisting @@ -74,7 +74,7 @@ data OpenMode | 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 @@ -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