Copyright | (c) Andrey Mulik 2019-2021 |
---|---|
License | BSD-style |
Maintainer | [email protected] |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe |
Language | Haskell2010 |
SDP.SortM
Synopsis
- class SortM m s e | s -> m, s -> e where
- type SortM1 m s e = SortM m (s e) e
- type SortM2 m s i e = SortM m (s i e)
- type SortM' m s = forall e. SortM m (s e) e
- type SortM'' m s = forall i e. SortM m (s i e)
- sortM :: (SortM m s e, Ord e) => s -> m ()
- sortMOn :: (SortM m s e, Ord o) => (e -> o) -> s -> m ()
- sortedM :: (SortM m s e, Ord e) => s -> m Bool
- sortedMOn :: (SortM m s e, Ord o) => (e -> o) -> s -> m Bool
SortM
class SortM m s e | s -> m, s -> e where Source #
SortM
is class of sortable mutable structures.
Methods
sortedMBy :: (e -> e -> Bool) -> s -> m Bool Source #
Checks if structure is already sorted. Should always return True
for
structures with less than 2 elements.
sortMBy :: Compare e -> s -> m () Source #
sortMBy
is common sorting algorithm.
Instances
(MonadIO io, Unboxed e) => SortM io (MIOBytes# io e) e Source # | |
MonadIO io => SortM io (MIOArray# io e) e Source # | |
(BorderedM1 m rep Int e, SortM1 m rep e, SplitM1 m rep e, LinearM1 m rep e) => SortM m (AnyChunks rep e) e Source # | |
(Index i, SortM1 m rep e) => SortM m (AnyBorder rep i e) e Source # | |
Unboxed e => SortM (ST s) (STBytes# s e) e Source # | |
SortM (ST s) (STArray# s e) e Source # | |
type SortM2 m s i e = SortM m (s i e) Source #
SortM
contraint for (Type -> Type -> Type)
-kind types.
Rank 2 quantified constraints
GHC 8.6.1+ only
type SortM' m s = forall e. SortM m (s e) e Source #
SortM
quantified contraint for (Type -> Type)
-kind types.
type SortM'' m s = forall i e. SortM m (s i e) Source #
SortM
quantified contraint for (Type -> Type -> Type)
-kind types.