| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.Parser.Deterministic
Description
Deterministic parsers can be restricted to succeed with a single parsing result.
Synopsis
- class Parsing m => DeterministicParsing (m :: Type -> Type) where
Documentation
class Parsing m => DeterministicParsing (m :: Type -> Type) where Source #
Combinator methods for constructing deterministic parsers, i.e., parsers that can succeed with only a single result.
Minimal complete definition
Nothing
Methods
(<<|>) :: m a -> m a -> m a infixl 3 Source #
Left-biased choice: if the left alternative succeeds, the right one is never tried.
takeOptional :: m a -> m (Maybe a) Source #
Like optional, but never succeeds with Nothing if the argument parser can succeed.
takeMany :: m a -> m [a] Source #
Like many, but always consuming the longest matching sequence of input.
takeSome :: m a -> m [a] Source #
Like some, but always consuming the longest matching sequence of input.
concatAll :: Monoid a => m a -> m a Source #
Like concatMany, but always consuming the longest matching sequence of input.
skipAll :: m a -> m () Source #
Like skipMany, but always consuming the longest matching sequence of input.
Instances
| DeterministicParsing Parser Source # | |
Defined in Text.Parser.Deterministic | |
| DeterministicParsing Parser Source # | |
Defined in Text.Parser.Deterministic | |
| DeterministicParsing ReadP Source # | |
Defined in Text.Parser.Deterministic | |
| DeterministicParsing (Lazy Get) Source # | |
Defined in Text.Parser.Deterministic | |
| DeterministicParsing (Strict Get) Source # | |
Defined in Text.Parser.Deterministic | |
| (Monad m, DeterministicParsing m) => DeterministicParsing (IdentityT m) Source # | |
Defined in Text.Parser.Deterministic Methods (<<|>) :: IdentityT m a -> IdentityT m a -> IdentityT m a Source # takeOptional :: IdentityT m a -> IdentityT m (Maybe a) Source # takeMany :: IdentityT m a -> IdentityT m [a] Source # takeSome :: IdentityT m a -> IdentityT m [a] Source # concatAll :: Monoid a => IdentityT m a -> IdentityT m a Source # | |
| (MonadPlus m, DeterministicParsing m) => DeterministicParsing (ReaderT e m) Source # | |
Defined in Text.Parser.Deterministic Methods (<<|>) :: ReaderT e m a -> ReaderT e m a -> ReaderT e m a Source # takeOptional :: ReaderT e m a -> ReaderT e m (Maybe a) Source # takeMany :: ReaderT e m a -> ReaderT e m [a] Source # takeSome :: ReaderT e m a -> ReaderT e m [a] Source # concatAll :: Monoid a => ReaderT e m a -> ReaderT e m a Source # | |
| (MonadPlus m, DeterministicParsing m, Monoid w) => DeterministicParsing (StateT w m) Source # | |
Defined in Text.Parser.Deterministic | |
| (MonadPlus m, DeterministicParsing m, Monoid w) => DeterministicParsing (StateT w m) Source # | |
Defined in Text.Parser.Deterministic | |
| (MonadPlus m, DeterministicParsing m, Monoid w) => DeterministicParsing (WriterT w m) Source # | |
Defined in Text.Parser.Deterministic Methods (<<|>) :: WriterT w m a -> WriterT w m a -> WriterT w m a Source # takeOptional :: WriterT w m a -> WriterT w m (Maybe a) Source # takeMany :: WriterT w m a -> WriterT w m [a] Source # takeSome :: WriterT w m a -> WriterT w m [a] Source # concatAll :: Monoid a => WriterT w m a -> WriterT w m a Source # | |
| (MonadPlus m, DeterministicParsing m, Monoid w) => DeterministicParsing (WriterT w m) Source # | |
Defined in Text.Parser.Deterministic Methods (<<|>) :: WriterT w m a -> WriterT w m a -> WriterT w m a Source # takeOptional :: WriterT w m a -> WriterT w m (Maybe a) Source # takeMany :: WriterT w m a -> WriterT w m [a] Source # takeSome :: WriterT w m a -> WriterT w m [a] Source # concatAll :: Monoid a => WriterT w m a -> WriterT w m a Source # | |
| (MonadPlus m, DeterministicParsing m, Monoid w) => DeterministicParsing (RWST r w s m) Source # | |
Defined in Text.Parser.Deterministic Methods (<<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source # takeOptional :: RWST r w s m a -> RWST r w s m (Maybe a) Source # takeMany :: RWST r w s m a -> RWST r w s m [a] Source # takeSome :: RWST r w s m a -> RWST r w s m [a] Source # concatAll :: Monoid a => RWST r w s m a -> RWST r w s m a Source # | |
| (MonadPlus m, DeterministicParsing m, Monoid w) => DeterministicParsing (RWST r w s m) Source # | |
Defined in Text.Parser.Deterministic Methods (<<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source # takeOptional :: RWST r w s m a -> RWST r w s m (Maybe a) Source # takeMany :: RWST r w s m a -> RWST r w s m [a] Source # takeSome :: RWST r w s m a -> RWST r w s m [a] Source # concatAll :: Monoid a => RWST r w s m a -> RWST r w s m a Source # | |