emgm-0.3.1: Extensible and Modular Generics for the MassesSource codeContentsIndex

Summary: Generic function that applies a (non-generic) function to every element in a value, splitting the element into two. The result are two structurally equivalent values, one with the elements from the first component of the splitting function and the other with the elements from the second component.

unzipWith can be seen as the dual of the zipWith function. It has no Prelude counterpart.

See also Generics.EMGM.Functions.ZipWith.

newtype UnzipWith a b c = UnzipWith {
selUnzipWith :: a -> (b, c)
unzipWith :: FRep3 UnzipWith f => (a -> (b, c)) -> f a -> (f b, f c)
unzip :: FRep3 UnzipWith f => f (a, b) -> (f a, f b)
newtype UnzipWith a b c Source
The type of a generic function that takes an argument of one type and returns a pair of values with two different types.
selUnzipWith :: a -> (b, c)
show/hide Instances
:: FRep3 UnzipWith f
=> a -> (b, c)Splitting function.
-> f aContainer of a-values.
-> (f b, f c)Pair of containers.
Splits a container into two structurally equivalent containers by applying a function to every element, which splits it into two corresponding elements.
unzip :: FRep3 UnzipWith f => f (a, b) -> (f a, f b)Source
Transforms a container of pairs into a container of first components and a container of second components. This is a generic version of the Prelude function of the same name.
Produced by Haddock version 2.4.2