Safe Haskell | None |
---|---|
Language | Haskell2010 |
Support for STL-style iterators. The functions in this module modify a
class to add functionality that is provided by different types of STL
iterators. In the method pseudotypes documented here, the parameter types
are Type
s, and all methods are nonpure.
- data IteratorMutability
- makeTrivialIterator :: IteratorMutability -> Maybe Type -> Class -> Class
- makeForwardIterator :: IteratorMutability -> Maybe Type -> Class -> Class
- makeBidirectionalIterator :: IteratorMutability -> Maybe Type -> Class -> Class
- makeRandomIterator :: IteratorMutability -> Maybe Type -> Type -> Class -> Class
Documentation
data IteratorMutability Source #
Whether an iterator may be used to modify the underlying collection.
makeTrivialIterator :: IteratorMutability -> Maybe Type -> Class -> Class Source #
makeTrivialIteartor mutable valueTypeMaybe cls
turns a class into a
trivial iterator, adding:
- A default constructor named
new
. - The class features
Assignable
,Copyable
, andEquatable
. - operator*:
getConst :: this ->
; ifrefT
(constT
valueType)valueTypeMaybe
is present. - operator*:
get :: this ->
; ifrefT
valueTypevalueTypeMaybe
is present andmutable
isMutable
. - *iter = x:
put :: this -> valueType ->
; ifvoidT
valueTypeMaybe
is present andmutable
isMutable
.
makeForwardIterator :: IteratorMutability -> Maybe Type -> Class -> Class Source #
Turns a class into a forward iterator, including everything from
makeTrivialIterator
plus the pre-increment operator:
makeBidirectionalIterator :: IteratorMutability -> Maybe Type -> Class -> Class Source #
Turns a class into a bidirectional iterator, including everything from
makeForwardIterator
plus the pre-decrement operator:
makeRandomIterator :: IteratorMutability -> Maybe Type -> Type -> Class -> Class Source #
makeRandomIterator mutable valueTypeMaybe distanceType cls
turns a class
into a random iterator, including everything from makeBidirectionalIterator
plus some methods:
- operator+=:
add :: this -> distanceType ->
.refT
(objT
cls) - operator+:
plus :: this -> distanceType ->
.toGcT
cls - operator-=:
subtract :: distanceType ->
.refT
(objT
cls) - operator-:
minus :: distanceType ->
.toGcT
cls - operator-:
difference :: this -> this -> distanceType
. - operator[]:
atConst :: distanceType ->
; ifrefT
(constT
valueType)valueTypeMaybe
is present. - operator[]:
at :: distanceType ->
; ifrefT
valueTypevalueTypeMaybe
is present andmutable
isMutable
.