Safe Haskell | None |
---|---|
Language | Haskell98 |
- type StringBoomerang = Boomerang StringError String
- type StringPrinterParser = StringBoomerang
- type StringError = ParserError MajorMinorPos
- alpha :: StringBoomerang r (Char :- r)
- anyChar :: StringBoomerang r (Char :- r)
- char :: Char -> StringBoomerang r (Char :- r)
- digit :: StringBoomerang r (Char :- r)
- int :: StringBoomerang r (Int :- r)
- integer :: StringBoomerang r (Integer :- r)
- lit :: String -> StringBoomerang r r
- satisfy :: (Char -> Bool) -> StringBoomerang r (Char :- r)
- space :: StringBoomerang r (Char :- r)
- isComplete :: String -> Bool
- parseString :: StringBoomerang () (r :- ()) -> String -> Either StringError r
- unparseString :: StringBoomerang () (r :- ()) -> r -> Maybe String
Types
type StringBoomerang = Boomerang StringError String Source #
type StringPrinterParser = StringBoomerang Source #
Deprecated: Use StringBoomerang instead
type StringError = ParserError MajorMinorPos Source #
Combinators
alpha :: StringBoomerang r (Char :- r) Source #
matches alphabetic Unicode characters (lower-case, upper-case and title-case letters,
plus letters of caseless scripts and modifiers letters). (Uses isAlpha
)
lit :: String -> StringBoomerang r r Source #
a constant string
space :: StringBoomerang r (Char :- r) Source #
matches white-space characters in the Latin-1 range. (Uses isSpace
)
Running the Boomerang
isComplete :: String -> Bool Source #
Predicate to test if we have parsed all the strings.
Typically used as argument to parse1
see also: parseStrings
parseString :: StringBoomerang () (r :- ()) -> String -> Either StringError r Source #
run the parser
Returns the first complete parse or a parse error.
parseString (rUnit . lit "foo") ["foo"]
unparseString :: StringBoomerang () (r :- ()) -> r -> Maybe String Source #
run the printer
unparseString (rUnit . lit "foo") ()
Orphan instances
InitialPosition StringError Source # | |
(~) * a b => IsString (Boomerang StringError String a b) Source # | |