An Attoparsec compatibility layer for Parsec

Latest on Hackage:0.1.3

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

MIT licensed and maintained by Simon Hengel
# An Attoparsec compatibility layer for Parsec

`attoparsec-parsec` allows you to write parsers that can be compiled against
both [Attoparsec]( and


~~~ {.haskell}
import Prelude hiding (takeWhile)
import Data.Text (Text)
import qualified Data.Text as Text
import qualified Data.Text.IO as Text

import Data.Attoparsec.Text
import Data.Attoparsec.Text.Parsec

main :: IO ()
main = Text.interact (either error id . parseOnly removeDashes)

removeDashes :: Parser Text
removeDashes = Text.concat `fmap` sepBy text dash
text = takeWhile (/= '-')
dash = takeWhile1 (== '-')
Depends on:
Used by 1 package:
comments powered byDisqus