toolshed-0.15.0.0: Utilities used by other packages.

Safe HaskellSafe-Inferred

ToolShed.Data.Foldable

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Miscellaneous polymorphic operations on Foldable types.

Synopsis

Functions

gather :: (Foldable f, Ord a) => f a -> [[a]]Source

A specific instance of gatherBy.

gatherBy :: (Foldable f, Ord b) => (a -> b) -> f a -> [[a]]Source

  • Group equal (though not necessarily adjacent; c.f. groupBy) elements, according to the specified comparator.
  • The groups are returned in ascending order, whilst their elements remain in their original order.

Predicates

hasDuplicates :: (Foldable f, Ord a) => f a -> BoolSource

Whether the specified collection contains any equal items.