ContentsIndex
Org.Org.Semantic.HBase.Basic.Enumerated
Synopsis
class Enumerated a where
addNoWrapMaybe :: Integer -> a -> Maybe a
predMaybe :: a -> Maybe a
succMaybe :: a -> Maybe a
ordFrom :: a -> a -> Integer
succNMaybe :: Enumerated a => Integer -> a -> Maybe a
predNMaybe :: Enumerated a => Integer -> a -> Maybe a
class Enumerated a => BoundedStartEnumerated a where
nthFromStart :: Integer -> Maybe a
ordFromStart :: a -> Integer
succNWrap :: Integer -> a -> a
succWrap :: a -> a
class Enumerated a => BoundedEndEnumerated a where
nthFromEnd :: Integer -> Maybe a
ordFromEnd :: a -> Integer
predNWrap :: Integer -> a -> a
predWrap :: a -> a
class (BoundedStartEnumerated a, BoundedEndEnumerated a) => BoundedEnumerated a where
nthWrap :: Integer -> a
nValues :: Type a -> Integer
addWrap :: Integer -> a -> a
class (BoundedEnumerated a, IsInteger i) => BoundedEnumeratedTo i a | a -> i where
nthFromStartLimited :: i -> Maybe a
ordFromStartLimited :: a -> i
nthWrapLimited :: i -> a
nValuesLimited :: Type a -> i
addWrapLimited :: i -> a -> a
class Enumerated a => UnboundedStartEnumerated a where
pred :: a -> a
predN :: Integer -> a -> a
class Enumerated a => UnboundedEndEnumerated a where
succ :: a -> a
succN :: Integer -> a -> a
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
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
Enumerated Integer
Enumerated Word8
Enumerated Int8
Enumerated Word16
Enumerated Int16
Enumerated Word32
Enumerated Int32
Enumerated Word64
Enumerated Int64
Enumerated Char
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
BoundedStartEnumerated Word8
BoundedStartEnumerated Int8
BoundedStartEnumerated Word16
BoundedStartEnumerated Int16
BoundedStartEnumerated Word32
BoundedStartEnumerated Int32
BoundedStartEnumerated Word64
BoundedStartEnumerated Int64
BoundedStartEnumerated Char
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
BoundedEndEnumerated Word8
BoundedEndEnumerated Int8
BoundedEndEnumerated Word16
BoundedEndEnumerated Int16
BoundedEndEnumerated Word32
BoundedEndEnumerated Int32
BoundedEndEnumerated Word64
BoundedEndEnumerated Int64
BoundedEndEnumerated Char
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
nthWrap :: Integer -> a
nValues :: Type a -> Integer
addWrap :: Integer -> a -> a
Instances
BoundedEnumerated Word8
BoundedEnumerated Int8
BoundedEnumerated Word16
BoundedEnumerated Int16
BoundedEnumerated Word32
BoundedEnumerated Int32
BoundedEnumerated Word64
BoundedEnumerated Int64
BoundedEnumerated Char
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
BoundedEnumeratedTo Word32 Char
class Enumerated a => UnboundedStartEnumerated a where
Methods
pred :: a -> a
predN :: Integer -> a -> a
Instances
UnboundedStartEnumerated Integer
class Enumerated a => UnboundedEndEnumerated a where
Methods
succ :: a -> a
succN :: Integer -> a -> a
Instances
UnboundedEndEnumerated Integer
class (Additive Integer a a, Subtractive Integer a a, UnboundedStartEnumerated a, UnboundedEndEnumerated a) => UnboundedEnumerated a
Instances
(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