|
Org.Org.Semantic.HBase.Basic.Enumerated |
|
|
|
|
|
Synopsis |
|
|
|
Documentation |
|
class Enumerated a where |
A type where each value has a predecessor and a successor,
except possibly for "start" and "end" values. | | Methods | addNoWrapMaybe :: Integer -> a -> Maybe a | Won't wrap. | | predMaybe :: a -> Maybe a | Won't wrap. | | succMaybe :: a -> Maybe a | | ordFrom :: a -> a -> Integer |
| | Instances | |
|
|
succNMaybe :: Enumerated a => Integer -> a -> Maybe a |
|
predNMaybe :: Enumerated a => Integer -> a -> Maybe a |
|
class Enumerated a => BoundedStartEnumerated a where |
An Enumerated type where there is a "start" value
which has no predecessor. | | Methods | nthFromStart :: Integer -> Maybe a | Nothing if i<0 or i past end-bound | | ordFromStart :: a -> Integer | of course, nthFromStart . ordFromStart == Just | | succNWrap :: Integer -> a -> a | Successor, wrapping to the start if ever hitting any end. | | succWrap :: a -> a |
| | Instances | |
|
|
class Enumerated a => BoundedEndEnumerated a where |
| Methods | nthFromEnd :: Integer -> Maybe a | - 1 is the last value, -2 the one before that etc.
| | ordFromEnd :: a -> Integer | | predNWrap :: Integer -> a -> a | Predecessor, wrapping to the end if ever hitting any start. | | predWrap :: a -> a |
| | Instances | |
|
|
class (BoundedStartEnumerated a, BoundedEndEnumerated a) => BoundedEnumerated a where |
A type where each value has a predecessor and a successor,
except for "start" and "end" values.
Note that add and subtract operations will wrap. | | Methods | | | Instances | |
|
|
class (BoundedEnumerated a, IsInteger i) => BoundedEnumeratedTo i a | a -> i where |
| Methods | nthFromStartLimited :: i -> Maybe a | Nothing if i<0 or i past end-bound | | ordFromStartLimited :: a -> i | of course, nthFromStart . ordFromStart == Just | | nthWrapLimited :: i -> a | | nValuesLimited :: Type a -> i | | addWrapLimited :: i -> a -> a |
| | Instances | |
|
|
class Enumerated a => UnboundedStartEnumerated a where |
| Methods | pred :: a -> a | | predN :: Integer -> a -> a |
| | Instances | |
|
|
class Enumerated a => UnboundedEndEnumerated a where |
| Methods | succ :: a -> a | | succN :: Integer -> a -> a |
| | Instances | |
|
|
class (Additive Integer a a, Subtractive Integer a a, UnboundedStartEnumerated a, UnboundedEndEnumerated a) => UnboundedEnumerated a |
|
|
inRangeForEnumerated :: Ordered i => (i, i) -> (i -> a) -> i -> Maybe a |
|
inBoundedRangeForEnumerated :: BoundedEnumerated a => (Integer -> a) -> Integer -> Maybe a |
|
inBoundedRangeForEnumeratedLimited :: BoundedEnumeratedTo i a => (i -> a) -> i -> Maybe a |
|
Produced by Haddock version 0.6 |