@@ -555,9 +555,9 @@ unsafeMove = G.unsafeMove
555
555
-- -----------------
556
556
557
557
-- | Compute the (lexicographically) next permutation of the given vector in-place.
558
- -- Returns False when the input is the last permutation; in this case the vector
559
- -- will not get updated, as opposed to the behavior of the C++ function
560
- -- @std::next_permutation@.
558
+ -- Returns False when the input is the last item in the enumeration, i.e., if it is in
559
+ -- weakly descending order. In this case the vector will not get updated,
560
+ -- as opposed to the behavior of the C++ function @std::next_permutation@.
561
561
--
562
562
-- @since 0.13.2.0
563
563
nextPermutation :: (PrimMonad m , Ord e ) => MVector (PrimState m ) e -> m Bool
@@ -566,27 +566,33 @@ nextPermutation = G.nextPermutation
566
566
567
567
-- | Compute the (lexicographically) next permutation of the given vector in-place,
568
568
-- using the provided comparison function.
569
- -- Returns False when the input is the last permutation; in this case the vector
570
- -- will not get updated, as opposed to the behavior of the C++ function
571
- -- @std::next_permutation@.
572
- nextPermutationBy :: (PrimMonad m ) => (e -> e -> Ordering ) -> MVector (PrimState m ) e -> m Bool
569
+ -- Returns False when the input is the last item in the enumeration, i.e., if it is in
570
+ -- weakly descending order. In this case the vector will not get updated,
571
+ -- as opposed to the behavior of the C++ function @std::next_permutation@.
572
+ --
573
+ -- @since 0.13.2.0
574
+ nextPermutationBy :: PrimMonad m => (e -> e -> Ordering ) -> MVector (PrimState m ) e -> m Bool
573
575
{-# INLINE nextPermutationBy #-}
574
576
nextPermutationBy = G. nextPermutationBy
575
577
576
578
-- | Compute the (lexicographically) previous permutation of the given vector in-place.
577
- -- Returns False when the input is the last permutation; in this case the vector
578
- -- will not get updated, as opposed to the behavior of the C++ function
579
- -- @std::next_permutation@.
579
+ -- Returns False when the input is the last item in the enumeration, i.e., if it is in
580
+ -- weakly ascending order. In this case the vector will not get updated,
581
+ -- as opposed to the behavior of the C++ function @std::prev_permutation@.
582
+ --
583
+ -- @since 0.13.2.0
580
584
prevPermutation :: (PrimMonad m , Ord e ) => MVector (PrimState m ) e -> m Bool
581
585
{-# INLINE prevPermutation #-}
582
586
prevPermutation = G. prevPermutation
583
587
584
588
-- | Compute the (lexicographically) previous permutation of the given vector in-place,
585
589
-- using the provided comparison function.
586
- -- Returns False when the input is the last permutation; in this case the vector
587
- -- will not get updated, as opposed to the behavior of the C++ function
588
- -- @std::next_permutation@.
589
- prevPermutationBy :: (PrimMonad m ) => (e -> e -> Ordering ) -> MVector (PrimState m ) e -> m Bool
590
+ -- Returns False when the input is the last item in the enumeration, i.e., if it is in
591
+ -- weakly ascending order. In this case the vector will not get updated,
592
+ -- as opposed to the behavior of the C++ function @std::prev_permutation@.
593
+ --
594
+ -- @since 0.13.2.0
595
+ prevPermutationBy :: PrimMonad m => (e -> e -> Ordering ) -> MVector (PrimState m ) e -> m Bool
590
596
{-# INLINE prevPermutationBy #-}
591
597
prevPermutationBy = G. prevPermutationBy
592
598
0 commit comments