chatty-text-0.6.2.0: Provides some classes and types for dealing with text, using the fundaments of Chatty.

Safe HaskellSafe
LanguageHaskell2010

Text.Chatty.Parser.Nondeterministic

Description

Provides a nondeterministic ChParser instance.

Synopsis

Documentation

data ForkerT m a Source

A nondeterministic parsing monad. Works by keeping multiple forks until they fail. May return multiple solutions. First parameter should be an instance of MonadPlus and Foldable.

Constructors

Result (m a) (Char -> ForkerT m a) 
Failed 

feedForkerT1 :: (MonadPlus m, Foldable m) => Char -> ForkerT m a -> ForkerT m a Source

Feed the ForkerT with a single input character.

feedForkerT :: (MonadPlus m, Foldable m) => String -> ForkerT m a -> ForkerT m a Source

Feed the ForkerT with some input string.

embedForkerT :: (MonadPlus n, Foldable n, ChScanner m) => ForkerT n a -> m (n a) Source

Embed the ForkerT into a running MonadScanner instance.