willow-0.1.0.0: An implementation of the web Document Object Model, and its rendering.
Copyright | (c) 2020-2021 Sam May |
---|---|
License | MPL-2.0 |
Maintainer | ag.eitilt@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Web.Willow.Common.Parser.Util
Description
Synopsis
- range :: Ord a => a -> a -> a -> Bool
- choice :: Alternative m => [m a] -> m a
- findNext :: MonadParser parser stream token => parser out -> parser out
Documentation
Test whether a given value falls within the range defined by the two bounds, inclusive.
>>>
range 1 2 3
False
>>>
range 1 3 2
True
>>>
range 1 2 2
True
choice :: Alternative m => [m a] -> m a #
Reduce a list of Alternative
s, such that the first successful instance
will be run. If the list is empty, the resulting value will always fail.
findNext :: MonadParser parser stream token => parser out -> parser out #
Scan through the stream, until the given parser succeeds (discarding any tokens between the initial location and where the first success is found). Fails if the parser does not succeed at any point in the remainder of the stream.