packages feed

transformers 0.2.1.0 → 0.2.2.0

raw patch · 22 files changed

+87/−76 lines, 22 filesdep ~base

Dependency ranges changed: base

Files

Control/Monad/IO/Class.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.IO.Class -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/Class.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.Class -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/Cont.hs view
@@ -2,9 +2,9 @@ -- | -- Module      :  Control.Monad.Trans.Cont -- Copyright   :  (c) The University of Glasgow 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/Error.hs view
@@ -1,24 +1,27 @@-{- |-Module      :  Control.Monad.Trans.Error-Copyright   :  (c) Michael Weber <michael.weber@post.rwth-aachen.de> 2001,-               (c) Jeff Newbern 2003-2006,-               (c) Andriy Palamarchuk 2006-License     :  BSD-style (see the file libraries/base/LICENSE)--Maintainer  :  libraries@haskell.org-Stability   :  experimental-Portability :  portable--This monad transformer adds the ability to fail or throw exceptions-to a monad.--A sequence of actions succeeds, producing a value, only if all the actions-in the sequence are successful.  If one fails with an error, the rest-of the sequence is skipped and the composite action fails with that error.--If the value of the error is not required, the variant in-"Control.Monad.Trans.Maybe" may be used instead.--}+{-# LANGUAGE CPP #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  Control.Monad.Trans.Error+-- Copyright   :  (c) Michael Weber <michael.weber@post.rwth-aachen.de> 2001,+--                (c) Jeff Newbern 2003-2006,+--                (c) Andriy Palamarchuk 2006+-- License     :  BSD-style (see the file LICENSE)+--+-- Maintainer  :  ross@soi.city.ac.uk+-- Stability   :  experimental+-- Portability :  portable+--+-- This monad transformer adds the ability to fail or throw exceptions+-- to a monad.+--+-- A sequence of actions succeeds, producing a value, only if all the+-- actions in the sequence are successful.  If one fails with an error,+-- the rest of the sequence is skipped and the composite action fails+-- with that error.+--+-- If the value of the error is not required, the variant in+-- "Control.Monad.Trans.Maybe" may be used instead.+-----------------------------------------------------------------------------  module Control.Monad.Trans.Error (     -- * The ErrorT monad transformer@@ -82,34 +85,39 @@ -- --------------------------------------------------------------------------- -- Our parameterizable error monad +#if !(MIN_VERSION_base(4,2,1))++-- These instances are in base-4.3+ instance Applicative (Either e) where     pure          = Right     Left  e <*> _ = Left e     Right f <*> r = fmap f r -instance (Error e) => Alternative (Either e) where-    empty        = Left noMsg-    Left _ <|> n = n-    m      <|> _ = m--instance (Error e) => Monad (Either e) where+instance Monad (Either e) where     return        = Right     Left  l >>= _ = Left l     Right r >>= k = k r-    fail msg      = Left (strMsg msg) -instance (Error e) => MonadPlus (Either e) where-    mzero            = Left noMsg-    Left _ `mplus` n = n-    m      `mplus` _ = m--instance (Error e) => MonadFix (Either e) where+instance MonadFix (Either e) where     mfix f = let         a = f $ case a of             Right r -> r             _       -> error "empty mfix argument"         in a +#endif /* base to 4.2.0.x */++instance (Error e) => Alternative (Either e) where+    empty        = Left noMsg+    Left _ <|> n = n+    m      <|> _ = m++instance (Error e) => MonadPlus (Either e) where+    mzero            = Left noMsg+    Left _ `mplus` n = n+    m      `mplus` _ = m+ -- | The error monad transformer. It can be used to add error handling -- to other monads. --@@ -223,12 +231,15 @@  {- $examples -> -- wraps IO action that can throw an error e+Wrapping an IO action that can throw an error @e@:+ > type ErrorWithIO e a = ErrorT e IO a > ==> ErrorT (IO (Either e a))->-> -- IO monad wrapped in StateT inside of ErrorT++An IO monad wrapped in @StateT@ inside of @ErrorT@:+ > type ErrorAndStateWithIO e s a = ErrorT e (StateT s IO) a > ==> ErrorT (StateT s IO (Either e a)) > ==> ErrorT (StateT (s -> IO (Either e a,s)))+ -}
Control/Monad/Trans/Identity.hs view
@@ -4,7 +4,7 @@ -- Copyright   :  (c) 2007 Magnus Therning -- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/List.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.List -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/Maybe.hs view
@@ -4,7 +4,7 @@ -- Copyright   :  (c) 2007 Yitzak Gale, Eric Kidd -- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/RWS.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.RWS -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/RWS/Lazy.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.RWS.Lazy -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/RWS/Strict.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.RWS.Strict -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/Reader.hs view
@@ -5,7 +5,7 @@ --                (c) Oregon Graduate Institute of Science and Technology, 2001 -- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/State.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.State -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/State/Lazy.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.State.Lazy -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/State/Strict.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.State.Strict -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/Writer.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.Writer -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/Writer/Lazy.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.Writer.Lazy -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Control/Monad/Trans/Writer/Strict.hs view
@@ -3,9 +3,9 @@ -- Module      :  Control.Monad.Trans.Writer.Strict -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology, 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Data/Functor/Compose.hs view
@@ -1,9 +1,9 @@ -- | -- Module      :  Data.Functor.Compose -- Copyright   :  (c) Ross Paterson 2010--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Data/Functor/Constant.hs view
@@ -1,9 +1,9 @@ -- | -- Module      :  Data.Functor.Constant -- Copyright   :  (c) Ross Paterson 2010--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Data/Functor/Identity.hs view
@@ -2,9 +2,9 @@ -- Module      :  Data.Functor.Identity -- Copyright   :  (c) Andy Gill 2001, --                (c) Oregon Graduate Institute of Science and Technology 2001--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
Data/Functor/Product.hs view
@@ -1,9 +1,9 @@ -- | -- Module      :  Data.Functor.Product -- Copyright   :  (c) Ross Paterson 2010--- License     :  BSD-style (see the file libraries/base/LICENSE)+-- License     :  BSD-style (see the file LICENSE) ----- Maintainer  :  libraries@haskell.org+-- Maintainer  :  ross@soi.city.ac.uk -- Stability   :  experimental -- Portability :  portable --
transformers.cabal view
@@ -1,5 +1,5 @@ name:         transformers-version:      0.2.1.0+version:      0.2.2.0 license:      BSD3 license-file: LICENSE author:       Andy Gill, Ross Paterson@@ -18,7 +18,7 @@     @monads-tf@ packages, which automatically lift operations introduced     by monad transformers through other transformers. build-type: Simple-cabal-version: >= 1.2+cabal-version: >= 1.5.5  flag ApplicativeInBase   description: Choose the newer base package, including Applicative and other