W3cubDocs

/Haskell 7

Control.Monad.Zip

Copyright (c) Nils Schweinsberg 2011, (c) George Giorgidze 2011 (c) University Tuebingen 2011
License BSD-style (see the file libraries/base/LICENSE)
Maintainer [email protected]
Stability experimental
Portability portable
Safe Haskell Safe
Language Haskell2010

Description

Monadic zipping (used for monad comprehensions)

class Monad m => MonadZip m where Source

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)

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

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/7.10.3/docs/html/libraries/base-4.8.2.0/Control-Monad-Zip.html