Add haddocks for constructors

This commit is contained in:
Andrew Martin 2019-09-05 09:24:10 -04:00
parent 1c17d129ff
commit 68897b9316
2 changed files with 9 additions and 5 deletions

View file

@ -27,8 +27,11 @@ import Data.Primitive (MutableByteArray(..))
-- when executed.
newtype Builder :: Nat -> Type where
Builder ::
(forall s. MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #))
(forall s. MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #))
-- ^ This function takes a buffer, an offset, and a number of remaining bytes.
-- It returns the new offset.
-> Builder n
-- | Constructor for 'Builder' that works on a function with lifted
-- arguments instead of unlifted ones. This is just as unsafe as the

View file

@ -31,10 +31,11 @@ import qualified Data.ByteArray.Builder.Bounded.Unsafe as UnsafeBounded
-- | An unmaterialized sequence of bytes that may be pasted
-- into a mutable byte array.
newtype Builder = Builder
-- This functions takes an offset and a number of remaining bytes
-- and returns the new offset.
(forall s. MutableByteArray# s -> Int# -> Int# -> State# s -> (# State# s, Int# #))
newtype Builder
= Builder (forall s. MutableByteArray# s -> Int# -> Int# -> State# s -> (# State# s, Int# #))
-- ^ This function takes a buffer, an offset, and a number of remaining bytes.
-- It returns the new offset (should be greater than the old offset), or if
-- there was not enough space left in buffer, it returns -1.
instance IsString Builder where
{-# inline fromString #-}