HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Modulerelude-1.2.2.2Haskell2010

Relude.Extra.Group

SPDX-License-Identifier : MIT Maintainer : Kowainik xrom.xkov@gmail.com Stability : Stable Portability : Portable

Polymorphic grouping functions.

Synopsis
  • Packagerelude-1.2.2.2
  • Exports2
  • LanguageHaskell2010
  • LicenceMIT
  • SourceGroup.hs
valuegroupBy
  1. :: (Foldable f, DynamicMap t, Val t ~ NonEmpty a, Monoid t)
  2. => a -> Key t
  3. -> f a
  4. -> t

Groups elements using results of the given function as keys.

Example1 expression
groupBy even [1..6] :: HashMap Bool (NonEmpty Int)fromList [(False,5 :| [3,1]),(True,6 :| [4,2])]