Safe Haskell | Trustworthy |
---|---|

Language | Haskell2010 |

## Synopsis

- 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
- word8s :: Integer -> [Word8]

# Documentation

Productive Stable Unordered Discriminator

class Grouping a where Source #

`Eq`

equipped with a compatible stable unordered discriminator.

Nothing

## Instances

class Grouping1 f where Source #

Nothing

grouping1 :: Group a -> Group (f a) Source #

grouping1 :: Deciding1 Grouping f => Group a -> Group (f a) Source #

## Instances

Grouping1 [] Source # | |

Grouping1 Maybe Source # | |

Grouping1 Complex 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.