Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Compatibilities.
Synopsis
- modifyM :: Monad m => (s -> m s) -> StateT s m ()
- nextPermutation :: (PrimMonad m, Ord e, MVector v e) => v (PrimState m) e -> m Bool
- nextPermutationBy :: (PrimMonad m, MVector v e) => (e -> e -> Ordering) -> v (PrimState m) e -> m Bool
- prevPermutation :: (PrimMonad m, Ord e, MVector v e) => v (PrimState m) e -> m Bool
- prevPermutationBy :: (PrimMonad m, MVector v e) => (e -> e -> Ordering) -> v (PrimState m) e -> m Bool
- nextPermutationByLt :: (PrimMonad m, MVector v e) => (e -> e -> Bool) -> v (PrimState m) e -> m Bool
Documentation
next permutation
nextPermutation :: (PrimMonad m, Ord e, MVector v e) => v (PrimState m) e -> m Bool #
Compute the (lexicographically) next permutation of the given vector in-place.
Returns False when the input is the last permutation; in this case the vector
will not get updated, as opposed to the behavior of the C++ function
std::next_permutation
.
nextPermutationBy :: (PrimMonad m, MVector v e) => (e -> e -> Ordering) -> v (PrimState m) e -> m Bool #
Compute the (lexicographically) next permutation of the given vector in-place,
using the provided comparison function.
Returns False when the input is the last permutation; in this case the vector
will not get updated, as opposed to the behavior of the C++ function
std::next_permutation
.
prevPermutation :: (PrimMonad m, Ord e, MVector v e) => v (PrimState m) e -> m Bool #
Compute the (lexicographically) previous permutation of the given vector in-place.
Returns False when the input is the last permutation; in this case the vector
will not get updated, as opposed to the behavior of the C++ function
std::next_permutation
.
prevPermutationBy :: (PrimMonad m, MVector v e) => (e -> e -> Ordering) -> v (PrimState m) e -> m Bool #
Compute the (lexicographically) previous permutation of the given vector in-place,
using the provided comparison function.
Returns False when the input is the last permutation; in this case the vector
will not get updated, as opposed to the behavior of the C++ function
std::next_permutation
.