Copyright | (c) 2016 Micxjo Funkcio |
---|---|
License | BSD3 |
Maintainer | micxjo@fastmail.com |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
- data Range a
- singleton :: a -> Range a
- range :: Ord a => a -> a -> Range a
- member :: Ord a => a -> Range a -> Bool
- notMember :: Ord a => a -> Range a -> Bool
- rangeMin :: Range a -> a
- rangeMax :: Range a -> a
- isSingleton :: Eq a => Range a -> Bool
- size :: Num a => Range a -> a
- intersection :: Ord a => Range a -> Range a -> Maybe (Range a)
- toList :: Enum a => Range a -> [a]
- toAscList :: Enum a => Range a -> [a]
- toDescList :: Enum a => Range a -> [a]
Range type
An inclusive, non-empty range.
Construction
Query
isSingleton :: Eq a => Range a -> Bool Source
Does the range contain only a single element?
Combine
intersection :: Ord a => Range a -> Range a -> Maybe (Range a) Source
The intersection of two ranges. If the ranges are disjoint, Nothing.
Conversion
toDescList :: Enum a => Range a -> [a] Source
All of the elements of the range, in descending order.