regex-tdfa-pipes-0.1.0.0: Parse with regular expressions on Producers.

Safe HaskellNone
LanguageHaskell2010

Text.Regex.TDFA.Pipes

Synopsis

Documentation

data CompOption :: *

Control whether the pattern is multiline or case-sensitive like Text.Regex and whether to capture the subgroups (1, 2, etc). Controls enabling extra anchor syntax.

compile :: (ProjectChar a, Monad m, Foldable m, Functor m) => CompOption -> ExecOption -> Producer a m () -> Either String Regex Source

Takes the output of a Producer to form a regular expression. This expression is then compiled using the options provided. If compilation fails an error message is returned.

If your regular expression is expressed as a String literal or some other Data.Foldable then "Pipes.each" is useful.

execute :: (ProjectChar a, Monad m, Foldable m, Functor m) => Regex -> Producer a m () -> Either a (Maybe MatchArray) Source

Execute a compiled regular expression on the output of a Producer.

regexec :: (ProjectChar a, Monad m, Foldable m, Functor m) => Regex -> Producer a m () -> Either String (Maybe (Producer a m (), Producer a m (), Producer a m (), [Producer a m ()])) Source

class ProjectChar a where Source

Types which can have a Char projected from them.

Methods

projectChar :: a -> Char Source

Project a Char from the type.