Skip to content

Add anyWord8 function to Data.Attoparsec.Zepto #205

@RyanGlScott

Description

@RyanGlScott

I recently found use for a version of the anyWord8 function defined over Zepto, which I implemented as:

import qualified Data.ByteString.Unsafe as BSU

anyWord8 :: Monad m => ZeptoT m Word8
anyWord8 = do
  b <- Zepto.take 1
  pure (BSU.unsafeHead b)

Since this requires using Data.ByteString.Unsafe, it would be nice to define this in attoparsec itself rather than in my downstream library (which would otherwise not need to make use of unsafe ByteString functions).

Metadata

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