HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

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])]