Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
- newtype Group a = Group {
- getGroup :: forall m b. PrimMonad m => (b -> m (b -> m ())) -> m (a -> b -> m ())
- 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
- groupingNat :: Int -> Group Int
Documentation
Productive Stable Unordered Discriminator
Eq
equipped with a compatible stable unordered discriminator.
Nothing
Grouping Bool Source | |
Grouping Int Source | |
Grouping Int8 Source | |
Grouping Int16 Source | |
Grouping Int32 Source | |
Grouping Int64 Source | |
Grouping Word Source | |
Grouping Word8 Source | |
Grouping Word16 Source | |
Grouping Word32 Source | |
Grouping Word64 Source | |
Grouping Void Source | |
Grouping a => Grouping [a] Source | |
(Grouping a, Integral a) => Grouping (Ratio a) Source | |
Grouping a => Grouping (Complex a) Source | |
Grouping a => Grouping (Maybe a) Source | |
(Grouping a, Grouping b) => Grouping (Either a b) Source | |
(Grouping a, Grouping b) => Grouping (a, b) Source | |
(Grouping a, Grouping b, Grouping c) => Grouping (a, b, c) Source | |
(Grouping1 f, Grouping1 g, Grouping a) => Grouping (Compose f g a) Source | |
(Grouping a, Grouping b, Grouping c, Grouping d) => Grouping (a, b, c, d) Source |
class Grouping1 f where Source
Nothing
Grouping1 [] Source | |
Grouping1 Complex Source | |
Grouping1 Maybe Source | |
Grouping a => Grouping1 (Either a) Source | |
Grouping a => Grouping1 ((,) a) Source | |
(Grouping a, Grouping b) => Grouping1 ((,,) a b) Source | |
(Grouping1 f, Grouping1 g) => Grouping1 (Compose f g) Source | |
(Grouping a, Grouping b, Grouping c) => Grouping1 ((,,,) a b c) 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.
Internals
hashing :: Hashable a => Group a Source
This may be useful for pragmatically accelerating a grouping structure by preclassifying by a hash function
Semantically,
grouping = hashing <> grouping
groupingNat :: Int -> Group Int Source