| category-extras-0.53.6: Various modules and constructs inspired by category theory | Contents | Index |
|
Control.Functor.Zip | Portability | portable | Stability | experimental | Maintainer | Edward Kmett <ekmett@gmail.com> |
|
|
|
Description |
Described in http://comonad.com/reader/2008/zipping-and-unzipping-functors/ and
http://comonad.com/reader/2008/cozipping/
|
|
Synopsis |
|
unfzip :: Functor f => f (a, b) -> (f a, f b) | | 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)) | | counzip :: Functor f => Either (f a) (f b) -> f (Either a b) | | 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)) | | class Functor f => Zip f where | fzip :: f a -> f b -> f (a, b) | fzipWith :: (a -> b -> c) -> f a -> f b -> f c |
| | class Bifunctor p Hask Hask Hask => Bizip p where | bizip :: p a c -> p b d -> p (a, b) (c, d) | bizipWith :: (a -> b -> e) -> (c -> d -> f) -> p a c -> p b d -> p e f |
| | class Functor f => Cozip f where | cozip :: f (Either a b) -> Either (f a) (f b) |
|
|
|
Documentation |
|
unfzip :: Functor f => f (a, b) -> (f a, f b) |
|
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)) |
|
counzip :: Functor f => Either (f a) (f b) -> f (Either a b) |
|
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)) |
|
class Functor f => Zip f where |
Minimum definition:
1. fzipWith
2. fzip
| | Methods | fzip :: f a -> f b -> f (a, b) | | fzipWith :: (a -> b -> c) -> f a -> f b -> f c |
| | Instances | |
|
|
class Bifunctor p Hask Hask Hask => Bizip p where |
Minimum definition:
1. bizipWith
2. bizip
| | Methods | bizip :: p a c -> p b d -> p (a, b) (c, d) | | bizipWith :: (a -> b -> e) -> (c -> d -> f) -> p a c -> p b d -> p e f |
| | Instances | |
|
|
class Functor f => Cozip f where |
| Methods | cozip :: f (Either a b) -> Either (f a) (f b) |
|
|
|
Produced by Haddock version 2.1.0 |