category-extras-0.44.1: Various modules and constructs inspired by category theory.

Portabilityportable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Functor.Zip

Description

 

Synopsis

Documentation

unfzip :: Functor f => f (a, b) -> (f a, f b)Source

unbizip :: Bifunctor p => p (a, c) (b, d) -> (p a b, p c d)Source

class Functor f => Zip f whereSource

Minimum definition:

  1. fzipWith
  2. fzip

Methods

fzip :: f a -> f b -> f (a, b)Source

fzipWith :: (a -> b -> c) -> f a -> f b -> f cSource

Instances

Zip [] 
Zip Maybe 
Zip Identity 
Monoid a => Zip (Either a) 
Monoid a => Zip ((,) a) 
Bizip p => Zip (FixB p) 

class Bifunctor p => Bizip p whereSource

Minimum definition:

  1. bizipWith
  2. bizip

Methods

bizip :: p a c -> p b d -> p (a, b) (c, d)Source

bizipWith :: (a -> b -> e) -> (c -> d -> f) -> p a c -> p b d -> p e fSource

Instances

Bizip (,) 
(Zip f, Bizip p) => Bizip (FunctorB f p) 
(Bizip p, Zip f, Zip g) => Bizip (BiffB p f g)