Portability | portable |
---|---|
Stability | none |
Maintainer | [email protected] |
Text.Parsec.Iteratee.LinkedList
Description
Module providing simple implementation based on mutable linked list. It is optimised for longer parsers.
- class Monad m => Reference r m where
- data (Monad m, Reference r m) => Cursor r m s el
- data (Monad m, Reference r m, ListLike s el) => NextCursor r m s el
- mkCursor :: (Monad m, Reference r m, ListLike s el) => m (Cursor r m s el)
- parsecIteratee :: (Monad m, Reference r m, Nullable c, ListLike c el) => ParsecT (Cursor r m c el) u (Iteratee c m) a -> u -> SourceName -> Iteratee c m (Either ParseError a)
- safeParsecIteratee :: (Monad m, Reference r m, Nullable c, ListLike c el) => ParsecT (Cursor r m c el) u (Iteratee c m) a -> u -> SourceName -> Iteratee c m (Either ParseError a)
Documentation
class Monad m => Reference r m where
Class connecting mutable variable and monad it exists in.
Methods
Arguments
:: a | An initial value |
-> m (r a) |
Create new reference.
Arguments
:: r a | Reference |
-> m a |
Reads a reference.
Arguments
:: r a | Reference |
-> a | New value |
-> m () |
Write to reference.
Arguments
:: r a | Reference |
-> (a -> m (a, b)) | Computation |
-> m b | Result of computation |
Modify the reference. Default implementation is provided but it MUST be overloaded if the reference is atomic to provide an atomic write.
data (Monad m, Reference r m) => Cursor r m s el Source
Cursor holds current value and reference to possible next cursor
data (Monad m, Reference r m, ListLike s el) => NextCursor r m s el Source
Specify the 3 possible states of next cursor - existence, non-existence and not being evaluated
Arguments
:: (Monad m, Reference r m, Nullable c, ListLike c el) | |
=> ParsecT (Cursor r m c el) u (Iteratee c m) a | Parser to run |
-> u | A user state |
-> SourceName | Source name |
-> Iteratee c m (Either ParseError a) |
Runs parser. If it suceed the remaining part of stream stands in stream, however if it fails the stream is not in defined state.
Arguments
:: (Monad m, Reference r m, Nullable c, ListLike c el) | |
=> ParsecT (Cursor r m c el) u (Iteratee c m) a | Parser to run |
-> u | A user state |
-> SourceName | Source name |
-> Iteratee c m (Either ParseError a) |
Runs parser. If it suceed the remaining part of stream stands in stream, however if it fails everything stands in stream.