Edison-1.2.1ContentsIndex
Data.Edison.Coll.Utils
PortabilityGHC, Hugs (MPTC and FD)
Stabilitystable
Maintainerrobdockins AT fastmail DOT fm
Description

This module provides implementations of several useful operations that are not included in the collection classes themselves. This is usually because the operation involves transforming a collection into a different type of collection; such operations cannot be typed using the collection classes without significantly complicating them.

Be aware that these functions are defined using the external class interfaces and may be less efficient than corresponding, but more restrictively typed, functions in the collection classes.

Synopsis
map :: (Coll cin a, CollX cout b) => (a -> b) -> cin -> cout
mapPartial :: (Coll cin a, CollX cout b) => (a -> Maybe b) -> cin -> cout
unsafeMapMonotonic :: (OrdColl cin a, OrdCollX cout b) => (a -> b) -> cin -> cout
unionMap :: (Coll cin a, CollX cout b) => (a -> cout) -> cin -> cout
Documentation
map :: (Coll cin a, CollX cout b) => (a -> b) -> cin -> cout
Apply a function across all the elements in a collection and transform the collection type.
mapPartial :: (Coll cin a, CollX cout b) => (a -> Maybe b) -> cin -> cout
Map a partial function across all elements of a collection and transform the collection type.
unsafeMapMonotonic :: (OrdColl cin a, OrdCollX cout b) => (a -> b) -> cin -> cout

Map a monotonic function across all the elements of a collection and transform the collection type. The function is required to satisfy the following precondition:

 forall x y. x < y ==> f x < f y
unionMap :: (Coll cin a, CollX cout b) => (a -> cout) -> cin -> cout
Map a collection-producing function across all elements of a collection and collect the results together using union.
Produced by Haddock version 0.8