range- This has a bunch of code for specifying and managing ranges in your code.

Safe HaskellSafe-Inferred



It should not be unexpected that you will be given a string representation of some ranges and you will need to parse them so that you can then do some further processing. This parser exists in order to make the most common forms of range strings easy to parse. It does not cover all cases however but you should not be too worried about that because you should be able to write your own parser using parsec or Alex/Happy and then you can convert everything that you parse into a RangeTree object for easier processing.



parseRanges :: Read a => String -> Either ParseError [Range a]Source

Given a string this function will either return a parse error back to the user or the list of ranges that are represented by the parsed string.

ranges :: Read a => RangeParserArgs -> Parser [Range a]Source

Given the parser arguments this returns a parser that is capable of parsing a list of ranges.

data RangeParserArgs Source

The arguments that are used, and can be modified, while parsing a standard range string.




unionSeparator :: String

A separator that represents a union.

rangeSeparator :: String

A separator that separates the two halves of a range.

wildcardSymbol :: String

A separator that implies an unbounded range.

defaultArgs :: RangeParserArgsSource

These are the default arguments that are used by the parser. Please feel free to use the default arguments for you own parser and modify it from the defaults at will.