ranges-0.2.3: Ranges and various functions on them.

Data.Ranges

Synopsis

Documentation

range :: Ord a => a -> a -> Range aSource

Construct a Range from a lower and upper bound.

ranges :: Ord a => [Range a] -> Ranges aSource

Construct a Ranges from a list of lower and upper bounds.

data Ord a => Range a Source

Instances

Ord a => Eq (Range a)

A rather hacked-up instance. This is to support fast lookups using Data.Set (see toSet).

Ord a => Ord (Range a) 
(Ord a, Show a) => Show (Range a) 

data Ord a => Ranges a Source

Instances

(Ord a, Show a) => Show (Ranges a) 

inRange :: Ord a => a -> Range a -> BoolSource

Tests if a given range contains a particular value.

inRanges :: Ord a => a -> Ranges a -> BoolSource

Tests if any of the ranges contains a particular value.

toSet :: Ord a => Ranges a -> Set (Range a)Source

Allows quick lookups using ranges.

single :: Ord a => a -> Range aSource

A range consisting of a single value.

addRange :: Ord a => Ranges a -> Range a -> Ranges aSource