Copyright | (c) Christian Maeder, DFKI GmbH 2010 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
frequently useful shortcuts mainly for character parsers
- (<<) :: Monad m => m a -> m b -> m a
- forget :: Monad m => m a -> m ()
- pair :: Monad m => m a -> m b -> m (a, b)
- (<:>) :: Monad m => m a -> m [a] -> m [a]
- (<++>) :: Monad m => m [a] -> m [a] -> m [a]
- (>->) :: Monad m => m a -> (a -> b) -> m b
- single :: Monad m => m a -> m [a]
- flat :: Monad m => m [[a]] -> m [a]
- enclosedBy :: Monad m => m [a] -> m a -> m [a]
- optionL :: GenParser tok st [a] -> GenParser tok st [a]
- tryString :: String -> CharParser st String
- nestedComment :: String -> String -> CharParser st String
- quotedLit :: Char -> CharParser st String
- stringLit :: CharParser st String
- sQuoted :: CharParser st String
- plainBlock :: String -> String -> CharParser st String
- reserved :: [String] -> CharParser st String -> CharParser st String
- sneakAhead :: CharParser st a -> CharParser st (Either ParseError a)
monad shortcuts
enclosedBy :: Monad m => m [a] -> m a -> m [a]
parsec shortcuts
tryString :: String -> CharParser st String
shortcut for try . string
nestedComment :: String -> String -> CharParser st String
nested comments, open and closing strings must have at least one char
quotedLit :: Char -> CharParser st String
a literal enclosed in quotes and a backslash as escape character
stringLit :: CharParser st String
text in double quotes
sQuoted :: CharParser st String
text in single quotes
plainBlock :: String -> String -> CharParser st String
non-nested block
reserved :: [String] -> CharParser st String -> CharParser st String
reject keywords
sneakAhead :: CharParser st a -> CharParser st (Either ParseError a)