Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Group a = Group {}
- class Grouping a where
- class Grouping1 f where
- nub :: Grouping a => [a] -> [a]
- nubWith :: Grouping b => (a -> b) -> [a] -> [a]
- group :: Grouping a => [a] -> [[a]]
- groupWith :: Grouping b => (a -> b) -> [a] -> [[a]]
- groupingEq :: Grouping a => a -> a -> Bool
- runGroup :: Group a -> [(a, b)] -> [[b]]
- hashing :: Hashable a => Group a
Documentation
Productive Stable Unordered Discriminator
class Grouping a where Source #
Eq
equipped with a compatible stable unordered discriminator.
Law:
groupingEq
x y ≡ (x==
y)
Note: Eq
is a moral super class of Grouping
.
It isn't because of some missing instances.
Nothing
Instances
class Grouping1 f where Source #
Nothing
Instances
Grouping1 [] Source # | |
Grouping1 Maybe Source # | |
Grouping1 Complex Source # | |
Grouping1 NonEmpty Source # | |
Grouping a => Grouping1 (Either a) Source # | |
Grouping a => Grouping1 ((,) a) Source # | |
(Grouping a, Grouping b) => Grouping1 ((,,) a b) Source # | |
(Grouping a, Grouping b, Grouping c) => Grouping1 ((,,,) a b c) Source # | |
(Grouping1 f, Grouping1 g) => Grouping1 (Compose f g) Source # | |
Combinators
groupWith :: Grouping b => (a -> b) -> [a] -> [[a]] Source #
O(n). This is a replacement for groupWith
using discrimination.
The result equivalence classes are not sorted, but the grouping is stable.