Hoogle Search
Within LTS Haskell 24.32 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
gi-glib GI.GLib.Structs.AsyncQueue Inserts data into queue using func to determine the new position. The sort function func is passed two elements of the queue. It should return 0 if they are equal, a negative value if the first element should be higher in the queue or a positive value if the first element should be lower in the queue than the second element. This function requires that the queue is sorted before pushing on new elements, see asyncQueueSort. This function must be called while holding the queue's lock. For an example of func see asyncQueueSort. Since: 2.10
asyncQueueSort :: (HasCallStack, MonadIO m) => AsyncQueue -> CompareDataFunc -> m ()gi-glib GI.GLib.Structs.AsyncQueue Sorts queue using func. The sort function func is passed two elements of the queue. It should return 0 if they are equal, a negative value if the first element should be higher in the queue or a positive value if the first element should be lower in the queue than the second element. This function will lock queue before it sorts the queue and unlock it when it is finished. If you were sorting a list of priority numbers to make sure the lowest priority would be at the top of the queue, you could use:
C code
gint32 id1; gint32 id2; id1 = GPOINTER_TO_INT (element1); id2 = GPOINTER_TO_INT (element2); return (id1 > id2 ? +1 : id1 == id2 ? 0 : -1);
Since: 2.10asyncQueueSortUnlocked :: (HasCallStack, MonadIO m) => AsyncQueue -> CompareDataFunc -> m ()gi-glib GI.GLib.Structs.AsyncQueue Sorts queue using func. The sort function func is passed two elements of the queue. It should return 0 if they are equal, a negative value if the first element should be higher in the queue or a positive value if the first element should be lower in the queue than the second element. This function must be called while holding the queue's lock. Since: 2.10
byteArraySort :: (HasCallStack, MonadIO m) => ByteString -> CompareFunc -> m ()gi-glib GI.GLib.Structs.ByteArray Sorts a byte array, using compareFunc which should be a qsort()-style comparison function (returns less than zero for first arg is less than second arg, zero for equal, greater than zero if first arg is greater than second arg). If two array elements compare equal, their order in the sorted array is undefined. If you want equal elements to keep their order (i.e. you want a stable sort) you can write a comparison function that, if two elements would otherwise compare equal, compares them by their addresses.
byteArraySortWithData :: (HasCallStack, MonadIO m) => ByteString -> CompareDataFunc -> m ()gi-glib GI.GLib.Structs.ByteArray Like byteArraySort, but the comparison function takes an extra user data argument.
hookInsertSorted :: (HasCallStack, MonadIO m) => HookList -> Hook -> HookCompareFunc -> m ()gi-glib GI.GLib.Structs.Hook Inserts a Hook into a HookList, sorted by the given function.
queueInsertSorted :: (HasCallStack, MonadIO m) => Queue -> Ptr () -> CompareDataFunc -> m ()gi-glib GI.GLib.Structs.Queue Inserts data into queue using func to determine the new position. Since: 2.4
queueSort :: (HasCallStack, MonadIO m) => Queue -> CompareDataFunc -> m ()gi-glib GI.GLib.Structs.Queue Sorts queue using compareFunc. Since: 2.4
-
gi-glib GI.GLib.Structs.Sequence 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
-
gi-glib GI.GLib.Structs.Sequence 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