haskell / attoparsec

A fast Haskell library for parsing ByteStrings
http://hackage.haskell.org/package/attoparsec
Other
514 stars 93 forks source link

Add satisfyMaybe #127

Open howsiyu opened 7 years ago

howsiyu commented 7 years ago

I find odd that attoparsec has satisfyWith :: (Word8 -> a) -> (a -> Bool) -> Parser a but not satisfyMaybe :: (Word8 -> Maybe a) -> Parser a since that is what I want most of the time.

Also, you can simulate satisfyWith using satisfyMaybe but not the other way round.