base-4.5.1.0: Basic libraries

Portabilityportable
Stabilityexperimental
Maintainer[email protected]
Safe HaskellSafe

Control.Monad.Zip

Description

Monadic zipping (used for monad comprehensions)

Synopsis

Documentation

class Monad m => MonadZip m whereSource

MonadZip type class. Minimal definition: mzip or mzipWith

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
 ==>
 munzip (mzip ma mb) = (ma, mb)

Methods

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

mzipWith :: (a -> b -> c) -> m a -> m b -> m cSource

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

Instances