| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GLib.Structs.Sequence
Contents
Synopsis
- newtype Sequence = Sequence (ManagedPtr Sequence)
- type family ResolveSequenceMethod (t :: Symbol) o where ...
- data SequenceAppendMethodInfo
- sequenceAppend :: (HasCallStack, MonadIO m) => Sequence -> Ptr () -> m SequenceIter
- data SequenceForeachMethodInfo
- sequenceForeach :: (HasCallStack, MonadIO m) => Sequence -> Func -> m ()
- sequenceForeachRange :: (HasCallStack, MonadIO m) => SequenceIter -> SequenceIter -> Func -> m ()
- data SequenceFreeMethodInfo
- sequenceFree :: (HasCallStack, MonadIO m) => Sequence -> m ()
- sequenceGet :: (HasCallStack, MonadIO m) => SequenceIter -> m (Ptr ())
- data SequenceGetBeginIterMethodInfo
- sequenceGetBeginIter :: (HasCallStack, MonadIO m) => Sequence -> m SequenceIter
- data SequenceGetEndIterMethodInfo
- sequenceGetEndIter :: (HasCallStack, MonadIO m) => Sequence -> m SequenceIter
- data SequenceGetIterAtPosMethodInfo
- sequenceGetIterAtPos :: (HasCallStack, MonadIO m) => Sequence -> Int32 -> m SequenceIter
- data SequenceGetLengthMethodInfo
- sequenceGetLength :: (HasCallStack, MonadIO m) => Sequence -> m Int32
- sequenceInsertBefore :: (HasCallStack, MonadIO m) => SequenceIter -> Ptr () -> m SequenceIter
- data SequenceInsertSortedMethodInfo
- sequenceInsertSorted :: (HasCallStack, MonadIO m) => Sequence -> Ptr () -> CompareDataFunc -> m SequenceIter
- data SequenceInsertSortedIterMethodInfo
- sequenceInsertSortedIter :: (HasCallStack, MonadIO m) => Sequence -> Ptr () -> SequenceIterCompareFunc -> m SequenceIter
- data SequenceIsEmptyMethodInfo
- sequenceIsEmpty :: (HasCallStack, MonadIO m) => Sequence -> m Bool
- data SequenceLookupMethodInfo
- sequenceLookup :: (HasCallStack, MonadIO m) => Sequence -> Ptr () -> CompareDataFunc -> m (Maybe SequenceIter)
- data SequenceLookupIterMethodInfo
- sequenceLookupIter :: (HasCallStack, MonadIO m) => Sequence -> Ptr () -> SequenceIterCompareFunc -> m (Maybe SequenceIter)
- sequenceMove :: (HasCallStack, MonadIO m) => SequenceIter -> SequenceIter -> m ()
- sequenceMoveRange :: (HasCallStack, MonadIO m) => SequenceIter -> SequenceIter -> SequenceIter -> m ()
- data SequencePrependMethodInfo
- sequencePrepend :: (HasCallStack, MonadIO m) => Sequence -> Ptr () -> m SequenceIter
- sequenceRangeGetMidpoint :: (HasCallStack, MonadIO m) => SequenceIter -> SequenceIter -> m SequenceIter
- sequenceRemove :: (HasCallStack, MonadIO m) => SequenceIter -> m ()
- sequenceRemoveRange :: (HasCallStack, MonadIO m) => SequenceIter -> SequenceIter -> m ()
- data SequenceSearchMethodInfo
- sequenceSearch :: (HasCallStack, MonadIO m) => Sequence -> Ptr () -> CompareDataFunc -> m SequenceIter
- data SequenceSearchIterMethodInfo
- sequenceSearchIter :: (HasCallStack, MonadIO m) => Sequence -> Ptr () -> SequenceIterCompareFunc -> m SequenceIter
- sequenceSet :: (HasCallStack, MonadIO m) => SequenceIter -> Ptr () -> m ()
- data SequenceSortMethodInfo
- sequenceSort :: (HasCallStack, MonadIO m) => Sequence -> CompareDataFunc -> m ()
- sequenceSortChanged :: (HasCallStack, MonadIO m) => SequenceIter -> CompareDataFunc -> m ()
- sequenceSortChangedIter :: (HasCallStack, MonadIO m) => SequenceIter -> SequenceIterCompareFunc -> m ()
- data SequenceSortIterMethodInfo
- sequenceSortIter :: (HasCallStack, MonadIO m) => Sequence -> SequenceIterCompareFunc -> m ()
- sequenceSwap :: (HasCallStack, MonadIO m) => SequenceIter -> SequenceIter -> m ()
Exported types
Memory-managed wrapper type.
Constructors
| Sequence (ManagedPtr Sequence) |
Instances
Methods
Click to display all available methods, including inherited ones
Methods
append, foreach, free, insertSorted, insertSortedIter, isEmpty, lookup, lookupIter, prepend, search, searchIter, sort, sortIter.
Getters
getBeginIter, getEndIter, getIterAtPos, getLength.
Setters
None.
type family ResolveSequenceMethod (t :: Symbol) o where ... Source #
Equations
append
data SequenceAppendMethodInfo Source #
Instances
| (signature ~ (Ptr () -> m SequenceIter), MonadIO m) => OverloadedMethod SequenceAppendMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceAppendMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Ptr () |
|
| -> m SequenceIter | Returns: an iterator pointing to the new item |
Adds a new item to the end of seq.
Since: 2.14
foreach
data SequenceForeachMethodInfo Source #
Instances
| (signature ~ (Func -> m ()), MonadIO m) => OverloadedMethod SequenceForeachMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceForeachMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Func |
|
| -> m () |
Calls func for each item in the sequence passing userData
to the function. func must not modify the sequence itself.
Since: 2.14
foreachRange
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> SequenceIter |
|
| -> Func |
|
| -> m () |
Calls func for each item in the range (begin, end) passing
userData to the function. func must not modify the sequence
itself.
Since: 2.14
free
data SequenceFreeMethodInfo Source #
Instances
| (signature ~ m (), MonadIO m) => OverloadedMethod SequenceFreeMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceFreeMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> m () |
Frees the memory allocated for seq. If seq has a data destroy
function associated with it, that function is called on all items
in seq.
Since: 2.14
get
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> m (Ptr ()) | Returns: the data that |
Returns the data that iter points to.
Since: 2.14
getBeginIter
data SequenceGetBeginIterMethodInfo Source #
Instances
| (signature ~ m SequenceIter, MonadIO m) => OverloadedMethod SequenceGetBeginIterMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceGetBeginIterMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> m SequenceIter | Returns: the begin iterator for |
Returns the begin iterator for seq.
Since: 2.14
getEndIter
data SequenceGetEndIterMethodInfo Source #
Instances
| (signature ~ m SequenceIter, MonadIO m) => OverloadedMethod SequenceGetEndIterMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceGetEndIterMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> m SequenceIter | Returns: the end iterator for |
Returns the end iterator for seg
Since: 2.14
getIterAtPos
data SequenceGetIterAtPosMethodInfo Source #
Instances
| (signature ~ (Int32 -> m SequenceIter), MonadIO m) => OverloadedMethod SequenceGetIterAtPosMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceGetIterAtPosMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Int32 |
|
| -> m SequenceIter | Returns: The |
Returns the iterator at position pos. If pos is negative or larger
than the number of items in seq, the end iterator is returned.
Since: 2.14
getLength
data SequenceGetLengthMethodInfo Source #
Instances
| (signature ~ m Int32, MonadIO m) => OverloadedMethod SequenceGetLengthMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceGetLengthMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> m Int32 | Returns: the length of |
Returns the positive length (>= 0) of seq. Note that this method is
O(h) where `h' is the height of the tree. It is thus more efficient
to use sequenceIsEmpty when comparing the length to zero.
Since: 2.14
insertBefore
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> Ptr () |
|
| -> m SequenceIter | Returns: an iterator pointing to the new item |
Inserts a new item just before the item pointed to by iter.
Since: 2.14
insertSorted
data SequenceInsertSortedMethodInfo Source #
Instances
| (signature ~ (Ptr () -> CompareDataFunc -> m SequenceIter), MonadIO m) => OverloadedMethod SequenceInsertSortedMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceInsertSortedMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Ptr () |
|
| -> CompareDataFunc |
|
| -> m SequenceIter | Returns: a |
Inserts data into seq using cmpFunc to determine the new
position. The sequence must already be sorted according to cmpFunc;
otherwise the new position of data is undefined.
cmpFunc is called with two items of the seq, and cmpData.
It should return 0 if the items are equal, a negative value
if the first item comes before the second, and a positive value
if the second item comes before the first.
Note that when adding a large amount of data to a Sequence,
it is more efficient to do unsorted insertions and then call
sequenceSort or sequenceSortIter.
Since: 2.14
insertSortedIter
data SequenceInsertSortedIterMethodInfo Source #
Instances
| (signature ~ (Ptr () -> SequenceIterCompareFunc -> m SequenceIter), MonadIO m) => OverloadedMethod SequenceInsertSortedIterMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceInsertSortedIterMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
sequenceInsertSortedIter Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Ptr () |
|
| -> SequenceIterCompareFunc |
|
| -> m SequenceIter | Returns: a |
Like sequenceInsertSorted, but uses
a SequenceIterCompareFunc instead of a CompareDataFunc as
the compare function.
iterCmp is called with two iterators pointing into seq.
It should return 0 if the iterators are equal, a negative
value if the first iterator comes before the second, and a
positive value if the second iterator comes before the first.
Note that when adding a large amount of data to a Sequence,
it is more efficient to do unsorted insertions and then call
sequenceSort or sequenceSortIter.
Since: 2.14
isEmpty
data SequenceIsEmptyMethodInfo Source #
Instances
| (signature ~ m Bool, MonadIO m) => OverloadedMethod SequenceIsEmptyMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceIsEmptyMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> m Bool |
Returns True if the sequence contains zero items.
This function is functionally identical to checking the result of
sequenceGetLength being equal to zero. However this function is
implemented in O(1) running time.
Since: 2.48
lookup
data SequenceLookupMethodInfo Source #
Instances
| (signature ~ (Ptr () -> CompareDataFunc -> m (Maybe SequenceIter)), MonadIO m) => OverloadedMethod SequenceLookupMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceLookupMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Ptr () |
|
| -> CompareDataFunc |
|
| -> m (Maybe SequenceIter) | Returns: an |
Returns an iterator pointing to the position of the first item found
equal to data according to cmpFunc and cmpData. If more than one
item is equal, it is not guaranteed that it is the first which is
returned. In that case, you can use sequenceIterNext and
sequenceIterPrev to get others.
cmpFunc is called with two items of the seq, and cmpData.
It should return 0 if the items are equal, a negative value if
the first item comes before the second, and a positive value if
the second item comes before the first.
This function will fail if the data contained in the sequence is unsorted.
Since: 2.28
lookupIter
data SequenceLookupIterMethodInfo Source #
Instances
| (signature ~ (Ptr () -> SequenceIterCompareFunc -> m (Maybe SequenceIter)), MonadIO m) => OverloadedMethod SequenceLookupIterMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceLookupIterMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Ptr () |
|
| -> SequenceIterCompareFunc |
|
| -> m (Maybe SequenceIter) | Returns: an |
Like sequenceLookup, but uses a SequenceIterCompareFunc
instead of a CompareDataFunc as the compare function.
iterCmp is called with two iterators pointing into seq.
It should return 0 if the iterators are equal, a negative value
if the first iterator comes before the second, and a positive
value if the second iterator comes before the first.
This function will fail if the data contained in the sequence is unsorted.
Since: 2.28
move
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> SequenceIter |
|
| -> m () |
Moves the item pointed to by src to the position indicated by dest.
After calling this function dest will point to the position immediately
after src. It is allowed for src and dest to point into different
sequences.
Since: 2.14
moveRange
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> SequenceIter |
|
| -> SequenceIter |
|
| -> m () |
Inserts the (begin, end) range at the destination pointed to by dest.
The begin and end iters must point into the same sequence. It is
allowed for dest to point to a different sequence than the one pointed
into by begin and end.
If dest is Nothing, the range indicated by begin and end is
removed from the sequence. If dest points to a place within
the (begin, end) range, the range does not move.
Since: 2.14
prepend
data SequencePrependMethodInfo Source #
Instances
| (signature ~ (Ptr () -> m SequenceIter), MonadIO m) => OverloadedMethod SequencePrependMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequencePrependMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Ptr () |
|
| -> m SequenceIter | Returns: an iterator pointing to the new item |
Adds a new item to the front of seq
Since: 2.14
rangeGetMidpoint
sequenceRangeGetMidpoint Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> SequenceIter |
|
| -> m SequenceIter | Returns: a |
Finds an iterator somewhere in the range (begin, end). This
iterator will be close to the middle of the range, but is not
guaranteed to be exactly in the middle.
The begin and end iterators must both point to the same sequence
and begin must come before or be equal to end in the sequence.
Since: 2.14
remove
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> m () |
Removes the item pointed to by iter. It is an error to pass the
end iterator to this function.
If the sequence has a data destroy function associated with it, this function is called on the data for the removed item.
Since: 2.14
removeRange
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> SequenceIter |
|
| -> m () |
Removes all items in the (begin, end) range.
If the sequence has a data destroy function associated with it, this function is called on the data for the removed items.
Since: 2.14
search
data SequenceSearchMethodInfo Source #
Instances
| (signature ~ (Ptr () -> CompareDataFunc -> m SequenceIter), MonadIO m) => OverloadedMethod SequenceSearchMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceSearchMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Ptr () |
|
| -> CompareDataFunc |
|
| -> m SequenceIter | Returns: an |
Returns an iterator pointing to the position where data would
be inserted according to cmpFunc and cmpData.
cmpFunc is called with two items of the seq, and cmpData.
It should return 0 if the items are equal, a negative value if
the first item comes before the second, and a positive value if
the second item comes before the first.
If you are simply searching for an existing element of the sequence,
consider using sequenceLookup.
This function will fail if the data contained in the sequence is unsorted.
Since: 2.14
searchIter
data SequenceSearchIterMethodInfo Source #
Instances
| (signature ~ (Ptr () -> SequenceIterCompareFunc -> m SequenceIter), MonadIO m) => OverloadedMethod SequenceSearchIterMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceSearchIterMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> Ptr () |
|
| -> SequenceIterCompareFunc |
|
| -> m SequenceIter | Returns: a |
Like sequenceSearch, but uses a SequenceIterCompareFunc
instead of a CompareDataFunc as the compare function.
iterCmp is called with two iterators pointing into seq.
It should return 0 if the iterators are equal, a negative value
if the first iterator comes before the second, and a positive
value if the second iterator comes before the first.
If you are simply searching for an existing element of the sequence,
consider using sequenceLookupIter.
This function will fail if the data contained in the sequence is unsorted.
Since: 2.14
set
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> Ptr () |
|
| -> m () |
Changes the data for the item pointed to by iter to be data. If
the sequence has a data destroy function associated with it, that
function is called on the existing data that iter pointed to.
Since: 2.14
sort
data SequenceSortMethodInfo Source #
Instances
| (signature ~ (CompareDataFunc -> m ()), MonadIO m) => OverloadedMethod SequenceSortMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceSortMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> CompareDataFunc |
|
| -> m () |
Sorts seq using cmpFunc.
cmpFunc is passed two items of seq and should
return 0 if they are equal, a negative value if the
first comes before the second, and a positive value
if the second comes before the first.
Since: 2.14
sortChanged
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> CompareDataFunc |
|
| -> m () |
Moves the data pointed to by iter to a new position as indicated by
cmpFunc. This
function should be called for items in a sequence already sorted according
to cmpFunc whenever some aspect of an item changes so that cmpFunc
may return different values for that item.
cmpFunc is called with two items of the seq, and cmpData.
It should return 0 if the items are equal, a negative value if
the first item comes before the second, and a positive value if
the second item comes before the first.
Since: 2.14
sortChangedIter
sequenceSortChangedIter Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> SequenceIterCompareFunc |
|
| -> m () |
Like sequenceSortChanged, but uses
a SequenceIterCompareFunc instead of a CompareDataFunc as
the compare function.
iterCmp is called with two iterators pointing into the Sequence that
iter points into. It should
return 0 if the iterators are equal, a negative value if the first
iterator comes before the second, and a positive value if the second
iterator comes before the first.
Since: 2.14
sortIter
data SequenceSortIterMethodInfo Source #
Instances
| (signature ~ (SequenceIterCompareFunc -> m ()), MonadIO m) => OverloadedMethod SequenceSortIterMethodInfo Sequence signature Source # | |
Defined in GI.GLib.Structs.Sequence Methods overloadedMethod :: Sequence -> signature # | |
| OverloadedMethodInfo SequenceSortIterMethodInfo Sequence Source # | |
Defined in GI.GLib.Structs.Sequence Methods | |
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Sequence |
|
| -> SequenceIterCompareFunc |
|
| -> m () |
Like sequenceSort, but uses a SequenceIterCompareFunc instead
of a CompareDataFunc as the compare function
cmpFunc is called with two iterators pointing into seq. It should
return 0 if the iterators are equal, a negative value if the first
iterator comes before the second, and a positive value if the second
iterator comes before the first.
Since: 2.14
swap
Arguments
| :: (HasCallStack, MonadIO m) | |
| => SequenceIter |
|
| -> SequenceIter |
|
| -> m () |
Swaps the items pointed to by a and b. It is allowed for a and b
to point into difference sequences.
Since: 2.14