Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add anyWord8 function to Data.Attoparsec.Zepto #205

Open
RyanGlScott opened this issue Mar 18, 2022 · 0 comments
Open

Add anyWord8 function to Data.Attoparsec.Zepto #205

RyanGlScott opened this issue Mar 18, 2022 · 0 comments

Comments

@RyanGlScott
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant