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

GHC 9.14.1 · lts/ghc-9.14.x · 6d5fdfd · 2026-10-12

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.