willow-0.1.0.0: An implementation of the web Document Object Model, and its rendering.
Copyright(c) 2020-2021 Sam May
LicenseMPL-2.0
Maintainerag.eitilt@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell98

Web.Willow.Common.Parser.Util

Description

 
Synopsis

Documentation

range Source #

Arguments

:: Ord a 
=> a

Low bound

-> a

High bound

-> a

Value to test

-> Bool 

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 Source #

Reduce a list of Alternatives, 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 Source #

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.