Copyright | (c) Andrey Mulik 2019-2021 |
---|---|
License | BSD-style |
Maintainer | work.a.mulik@gmail.com |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Synopsis
- class Sort s e | s -> e where
- type Sort1 rep e = Sort (rep e)
- type Sort2 rep i e = Sort (rep i e)
- type Sort' rep = forall e. Sort (rep e)
- type Sort'' rep = forall i e. Sort (rep i e)
- sort :: (Sort s e, Ord e) => s -> s
- sortOn :: (Sort s e, Ord o) => (e -> o) -> s -> s
- sorted :: (Sort s e, Ord e) => s -> Bool
- sortedOn :: (Sort s e, Ord o) => (e -> o) -> s -> Bool
Sort
class Sort s e | s -> e where Source #
Sort
is class of types that can be sorted.
sortedBy :: (e -> e -> Bool) -> s -> Bool Source #
Checks if structure is already sorted. Should always return True
for
structures with less than 2 elements.
sortBy :: Compare e -> s -> s Source #
sortBy
function is common sorting algorithm.
Rank 2 quantified constraints
GHC 8.6.1+ only
type Sort' rep = forall e. Sort (rep e) Source #
Sort
quantified contraint for (Type -> Type)
-kind types.
type Sort'' rep = forall i e. Sort (rep i e) Source #
Sort
quantified contraint for (Type -> Type -> Type)
-kind types.