Skip to content

Make invariant for lazy ByteString visible in haddock #695

Open
@Bodigrim

Description

data ByteString = Empty | Chunk {-# UNPACK #-} !S.StrictByteString ByteString
-- INVARIANT: The S.StrictByteString field of any Chunk is not empty.
-- (See also the 'invariant' and 'checkInvariant' functions.)
-- To make testing of this invariant convenient, we add an
-- assertion to that effect when the HS_BYTESTRING_ASSERTIONS
-- preprocessor macro is defined, by renaming the actual constructor
-- and providing a pattern synonym that does the checking:

This should really be a haddock-visible documentation for Chunk constructor instead of source-only comment.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions