toolshed-0.15.0.1: Utilities used by other packages.

Safe HaskellSafe-Inferred
LanguageHaskell98

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; cf. 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 -> Bool Source

Whether the specified collection contains any equal items.