mapMonotonic
The
mapMonotonic f s == map f s, but works only
when
f is strictly increasing. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls]
==> mapMonotonic f s == map f s
where ls = toList s
Warning: This function should be used only if
f is
monotonically strictly increasing. This precondition is not checked.
Use
map if the precondition may not hold.
mapMonotonic f s == map f s, but
works only when
f is strictly increasing. Semi-formally, we
have:
and [x < y ==> f x < f y | x <- ls, y <- ls]
==> mapMonotonic f s == map f s
where ls = toList s
Warning: This function should be used only if
f is
monotonically strictly increasing. This precondition is not checked.
Use
map if the precondition may not hold.
The
mapMonotonic f s == map f s, but works only
when
f is strictly increasing.
The precondition is not
checked. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls]
==> mapMonotonic f s == map f s
where ls = toList s
O(n). The
mapMonotonic f s == map f s, but works only
when
f is strictly increasing.
The precondition is not
checked. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls]
==> mapMonotonic f s == map f s
where ls = toList s
O(n). Map a strictly increasing function over all left keys in
the map. The precondition is not checked. Version 0.3
O(n).
mapMonotonic f s == map f s, but
works only when
f is strictly monotonic.
The precondition
is not checked. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls]
==> mapMonotonic f s == map f s
where ls = toList s
O(n).
mapMonotonic f s == map f s, but
works only when
f is strictly monotonic.
The precondition
is not checked. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls]
==> mapMonotonic f s == map f s
where ls = toList s
O(n). Map a monotone increasing function over the heap.
Provides a better constant factor for performance than
map, but
no checking is performed that the function provided is monotone
increasing. Misuse of this function can cause a Heap to violate the
heap property.
>>> mapMonotonic (+1) (fromList [1,2,3])
fromList [2,3,4]
>>> mapMonotonic (*2) (fromList [1,2,3])
fromList [2,4,6]
O(n).
mapMonotonic f s == map f s, but
works only when
f is strictly increasing.
The precondition
is not checked. Semi-formally, we have:
and [x < y ==> f x < f y | x <- ls, y <- ls]
==> mapMonotonic f s == map f s
where ls = Data.Foldable.toList s
mapMonotonic f i is the image of i under f,
where f must be a strict monotone function.
mapMonotonic f i is the image of i under f,
where f must be a strict monotone function, preserving
negative and positive infinities.
O(n).
mapMonotonic f s == map f s, but
works only when
f is strictly monotonic. That is, for any
values
x and
y, if
x <
y then
f x <
f y.
The precondition is not
checked.
O(n). Map a strictly increasing function over all right keys in
the map. The precondition is not checked. Version 0.3
O(n) Maps a function over the values and priorities of the
queue. The function f must be monotonic with respect to the
priorities. I.e. if x < y, then fst (f k x v) < fst
(f k y v). The precondition is not checked. If f
is not monotonic, then the result will be invalid.
O(n) Maps a function over the values and priorities of the
queue. The function f must be monotonic with respect to the
priorities. I.e. if x < y, then fst (f k x v) < fst
(f k y v). The precondition is not checked. If f
is not monotonic, then the result will be invalid.
O(n) Maps a function over the values and priorities of the
queue. The function f must be monotonic with respect to the
priorities. I.e. if x < y, then fst (f k x v) < fst
(f k y v). The precondition is not checked. If f
is not monotonic, then the result will be invalid.