base-4.18.3.0: Core data structures and operations
Copyright(c) Nils Schweinsberg 2011
(c) George Giorgidze 2011
(c) University Tuebingen 2011
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Zip

Description

Monadic zipping (used for monad comprehensions)

Synopsis

Documentation

class Monad m => MonadZip m where Source #

Instances should satisfy the laws:

Naturality
liftM (f *** g) (mzip ma mb)
    = mzip (liftM f ma) (liftM g mb)
Information Preservation

liftM (const ()) ma = liftM (const ()) mb implies munzip (mzip ma mb) = (ma, mb)

Minimal complete definition

mzip | mzipWith

Methods

mzip :: m a -> m b -> m (a, b) Source #

mzipWith :: (a -> b -> c) -> m a -> m b -> m c Source #

munzip :: m (a, b) -> (m a, m b) Source #

Instances

Instances details
MonadZip Complex Source #

Since: base-4.15.0.0

Instance details

Defined in Data.Complex

Methods

mzip :: Complex a -> Complex b -> Complex (a, b) Source #

mzipWith :: (a -> b -> c) -> Complex a -> Complex b -> Complex c Source #

munzip :: Complex (a, b) -> (Complex a, Complex b) Source #

MonadZip Identity Source #

Since: base-4.8.0.0

Instance details

Defined in Control.Monad.Zip

Methods

mzip :: Identity a -> Identity b -> Identity (a, b) Source #

mzipWith :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source #

munzip :: Identity (a, b) -> (Identity a, Identity b) Source #

MonadZip First Source #

Since: base-4.8.0.0

Instance details

Defined in Control.Monad.Zip

Methods

mzip :: First a -> First b -> First (a, b) Source #

mzipWith :: (a -> b -> c) -> First a -> First b -> First c Source #

munzip :: First (a, b) -> (First a, First b)