category-extras-0.53.5: 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 :: (PreCartesian r pr, PreCartesian s ps, PreCartesian t pt, Bifunctor p r s t) => t (p (pr a c) (ps b d)) (pt (p a b) (p c d))Source

counzip :: Functor f => Either (f a) (f b) -> f (Either a b)Source

counbizip :: (PreCoCartesian r sr, PreCoCartesian s ss, PreCoCartesian t st, Bifunctor q r s t) => t (st (q a c) (q b d)) (q (sr a b) (ss 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 (Fix p) 
Monoid t => Zip (Const2 t a) 

class Bifunctor p Hask Hask Hask => 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 (,) 
Monoid t => Bizip (Const2 t) 
(Bizip p, Zip f, Zip g) => Bizip (Biff p f g) 

class Functor f => Cozip f whereSource

Methods

cozip :: f (Either a b) -> Either (f a) (f b)Source

Instances