Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
Rg acts a bit like a Bounded Enum, but the size of the enumeration
can be dynamically determined from each value in the type (see sizeRg
)
the number of values in the enumeration; sizeRg sz > 0
toRg :: rg -> Int -> Maybe rg Source #
the nth item in the enumeration (first is 0)
place in the enumation (first is 0)
first item in the enumeration
last item in the enumeration
succRg :: rg -> Maybe rg Source #
next item in the enumeration (Nothing if already last)
predRg :: rg -> Maybe rg Source #
previous item in the enumeration (Nothing if already first)
allListRg :: rg -> [rg] Source #
list given items in the enumeration
listRg :: rg -> [Int] -> [rg] Source #
list given items in the enumeration, stopping as soon as an index is out of range
allVectorRg :: rg -> [rg] Source #
list given items in the enumeration as a Vector
vectorRg :: rg -> [Int] -> Vector rg Source #
list the items in the enumeration as a Vector
, stopping as soon as an
index is out of range
Instances
Rg (Range a) Source # | |
Defined in Data.Rg sizeRg :: Range a -> Int Source # toRg :: Range a -> Int -> Maybe (Range a) Source # fromRg :: Range a -> Int Source # minRg :: Range a -> Range a Source # maxRg :: Range a -> Range a Source # succRg :: Range a -> Maybe (Range a) Source # predRg :: Range a -> Maybe (Range a) Source # allListRg :: Range a -> [Range a] Source # listRg :: Range a -> [Int] -> [Range a] Source # allVectorRg :: Range a -> [Range a] Source # | |
(Bounded i, Enum i) => Rg (BE i) Source # | |
Defined in Data.Rg sizeRg :: BE i -> Int Source # toRg :: BE i -> Int -> Maybe (BE i) Source # fromRg :: BE i -> Int Source # minRg :: BE i -> BE i Source # maxRg :: BE i -> BE i Source # succRg :: BE i -> Maybe (BE i) Source # predRg :: BE i -> Maybe (BE i) Source # allListRg :: BE i -> [BE i] Source # listRg :: BE i -> [Int] -> [BE i] Source # allVectorRg :: BE i -> [BE i] Source # |
class (Rg e, Buildable e, Eq e, Ord e, Show e) => RgText e where Source #
a class in which we can build things and parse them from Text
Nothing
parseRgText :: e -> Text -> Possibly e Source #
Instances
Bounded a => Bounded (BE a) Source # | |
Enum a => Enum (BE a) Source # | |
Eq a => Eq (BE a) Source # | |
Ord a => Ord (BE a) Source # | |
Show a => Show (BE a) Source # | |
(Bounded i, Enum i) => Rg (BE i) Source # | |
Defined in Data.Rg sizeRg :: BE i -> Int Source # toRg :: BE i -> Int -> Maybe (BE i) Source # fromRg :: BE i -> Int Source # minRg :: BE i -> BE i Source # maxRg :: BE i -> BE i Source # succRg :: BE i -> Maybe (BE i) Source # predRg :: BE i -> Maybe (BE i) Source # allListRg :: BE i -> [BE i] Source # listRg :: BE i -> [Int] -> [BE i] Source # allVectorRg :: BE i -> [BE i] Source # |
used to generate Rg
values from lists of things
Instances
Show a => Show (Range a) Source # | |
Rg (Range a) Source # | |
Defined in Data.Rg sizeRg :: Range a -> Int Source # toRg :: Range a -> Int -> Maybe (Range a) Source # fromRg :: Range a -> Int Source # minRg :: Range a -> Range a Source # maxRg :: Range a -> Range a Source # succRg :: Range a -> Maybe (Range a) Source # predRg :: Range a -> Maybe (Range a) Source # allListRg :: Range a -> [Range a] Source # listRg :: Range a -> [Int] -> [Range a] Source # allVectorRg :: Range a -> [Range a] Source # |
newStartOfRangeFromList :: [a] -> Range a Source #
generating a Range
from a list
extractRange :: Range a -> a Source #
extracting the thing