hutt-0.1.0.0
Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Data.List.Group

Description

A module that defines functions that groups a list of elements into subsequences.

Synopsis

Grouping with the key

groupWith Source #

Arguments

:: Eq b 
=> (a -> b)

The given mapping function.

-> [a]

The list of items to group into non-empty sequences.

-> [(b, NonEmpty a)]

The list of groups.

Group the given list of items to a list of NonEmpty 2-tuples with the "key" and the value for a given mapping function.

groupWith' Source #

Arguments

:: (b -> b -> Bool)

The given equivalence relation.

-> (a -> b)

The given mapping function.

-> [a]

The list of items to group into non-empty sequences.

-> [(b, NonEmpty a)]

The list of groups.

Group the given list of items to a list of NonEmpty 2-tuples with the "key" and the value for a given mapping function and equavalence relation.