summaryrefslogtreecommitdiff
path: root/libraries/base/Control/Monad/Zip.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/Control/Monad/Zip.hs')
-rw-r--r--libraries/base/Control/Monad/Zip.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/libraries/base/Control/Monad/Zip.hs b/libraries/base/Control/Monad/Zip.hs
index fa44438176..f102ff06ad 100644
--- a/libraries/base/Control/Monad/Zip.hs
+++ b/libraries/base/Control/Monad/Zip.hs
@@ -52,48 +52,62 @@ class Monad m => MonadZip m where
-- you can implement it more efficiently than the
-- above default code. See Trac #4370 comment by giorgidze
+-- | @since 4.3.1.0
instance MonadZip [] where
mzip = zip
mzipWith = zipWith
munzip = unzip
+-- | @since 4.8.0.0
instance MonadZip Dual where
-- Cannot use coerce, it's unsafe
mzipWith = liftM2
+-- | @since 4.8.0.0
instance MonadZip Sum where
mzipWith = liftM2
+-- | @since 4.8.0.0
instance MonadZip Product where
mzipWith = liftM2
+-- | @since 4.8.0.0
instance MonadZip Maybe where
mzipWith = liftM2
+-- | @since 4.8.0.0
instance MonadZip First where
mzipWith = liftM2
+-- | @since 4.8.0.0
instance MonadZip Last where
mzipWith = liftM2
+-- | @since 4.8.0.0
instance MonadZip f => MonadZip (Alt f) where
mzipWith f (Alt ma) (Alt mb) = Alt (mzipWith f ma mb)
+-- | @since 4.9.0.0
instance MonadZip Proxy where
mzipWith _ _ _ = Proxy
-- Instances for GHC.Generics
+-- | @since 4.9.0.0
instance MonadZip U1 where
mzipWith _ _ _ = U1
+-- | @since 4.9.0.0
instance MonadZip Par1 where
mzipWith = liftM2
+-- | @since 4.9.0.0
instance MonadZip f => MonadZip (Rec1 f) where
mzipWith f (Rec1 fa) (Rec1 fb) = Rec1 (mzipWith f fa fb)
+-- | @since 4.9.0.0
instance MonadZip f => MonadZip (M1 i c f) where
mzipWith f (M1 fa) (M1 fb) = M1 (mzipWith f fa fb)
+-- | @since 4.9.0.0
instance (MonadZip f, MonadZip g) => MonadZip (f :*: g) where
mzipWith f (x1 :*: y1) (x2 :*: y2) = mzipWith f x1 x2 :*: mzipWith f y1 y2