HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

ModuleAgda-2.8.0.2Haskell2010

Agda.Utils.Cluster

Create clusters of non-overlapping things.

Synopsis
  • PackageAgda-2.8.0.2
  • Exports4
  • LanguageHaskell2010
  • LicenceMIT
  • SourceCluster.hs
valuecluster :: Ord c => (a -> NonEmpty c) -> [a] -> [NonEmpty a]

Given a function f :: a -> NonEmpty c which returns a non-empty list of characteristics of a, partition a list of as into groups such that each element in a group shares at least one characteristic with at least one other element of the group.

valuecluster' :: Ord c => [(a, NonEmpty c)] -> [NonEmpty a]

Partition a list of as paired with a non-empty list of characteristics into groups such that each element in a group shares at least one characteristic with at least one other element of the group.

valuecluster1
  1. :: Ord c
  2. => a -> NonEmpty c
  3. -> NonEmpty a
  4. -> NonEmpty (NonEmpty a)

Given a function f :: a -> NonEmpty c which returns a non-empty list of characteristics of a, partition a non-empty list of as into groups such that each element in a group shares at least one characteristic with at least one other element of the group.

valuecluster1' :: Ord c => NonEmpty (a, NonEmpty c) -> NonEmpty (NonEmpty a)

Partition a non-empty list of as paired with a non-empty list of characteristics into groups such that each element in a group shares at least one characteristic with at least one other element of the group.