diff --git a/default.nix b/default.nix index db94435..c886423 100644 --- a/default.nix +++ b/default.nix @@ -3,20 +3,20 @@ , filepath, hslogger, html, HUnit, monad-control, mtl, network , network-uri, old-locale, parsec, process, semigroups, sendfile , stdenv, syb, system-filepath, template-haskell, text, threads -, time, time-compat, transformers, transformers-base -, transformers-compat, unix, utf8-string, xhtml, zlib +, time, transformers, transformers-base, transformers-compat, unix +, utf8-string, xhtml, zlib }: mkDerivation { pname = "happstack-server"; - version = "7.5.0.2"; + version = "7.5.1.4"; src = ./.; libraryHaskellDepends = [ base base64-bytestring blaze-html bytestring containers directory exceptions extensible-exceptions filepath hslogger html monad-control mtl network network-uri old-locale parsec process semigroups sendfile syb system-filepath template-haskell text - threads time time-compat transformers transformers-base - transformers-compat unix utf8-string xhtml zlib + threads time transformers transformers-base transformers-compat + unix utf8-string xhtml zlib ]; testHaskellDepends = [ base bytestring containers HUnit parsec zlib diff --git a/happstack-server.cabal b/happstack-server.cabal index 638a5c1..5b4dc93 100644 --- a/happstack-server.cabal +++ b/happstack-server.cabal @@ -1,5 +1,5 @@ Name: happstack-server -Version: 7.5.1.4 +Version: 7.5.2 Synopsis: Web related tools and services. Description: Happstack Server provides an HTTP server and a rich set of functions for routing requests, handling query parameters, generating responses, working with cookies, serving files, and more. For in-depth documentation see the Happstack Crash Course License: BSD3 diff --git a/src/Happstack/Server/Internal/Monads.hs b/src/Happstack/Server/Internal/Monads.hs index 88091c8..e037147 100644 --- a/src/Happstack/Server/Internal/Monads.hs +++ b/src/Happstack/Server/Internal/Monads.hs @@ -16,6 +16,10 @@ import Control.Monad.Error ( ErrorT(ErrorT), runErrorT , Error, MonadError, throwError , catchError, mapErrorT ) +#if MIN_VERSION_base(4,9,0) +import Control.Monad.Fail (MonadFail) +import qualified Control.Monad.Fail as Fail +#endif import Control.Monad.Reader ( ReaderT(ReaderT), runReaderT , MonadReader, ask, local, mapReaderT ) @@ -70,7 +74,11 @@ type ServerPart a = ServerPartT IO a -- -- see also: 'simpleHTTP', 'ServerMonad', 'FilterMonad', 'WebMonad', and 'HasRqData' newtype ServerPartT m a = ServerPartT { unServerPartT :: ReaderT Request (WebT m) a } +#if MIN_VERSION_base(4,9,0) + deriving (Monad, MonadFail, MonadPlus, Functor) +#else deriving (Monad, MonadPlus, Functor) +#endif instance MonadCatch m => MonadCatch (ServerPartT m) where catch action handle = ServerPartT $ catch (unServerPartT action) (unServerPartT . handle) @@ -392,6 +400,11 @@ instance (Monad m) => FilterMonad a (FilterT a m) where newtype WebT m a = WebT { unWebT :: ErrorT Response (FilterT (Response) (MaybeT m)) a } deriving (Functor) +#if MIN_VERSION_base(4,9,0) +instance MonadFail m => MonadFail (WebT m) where + fail s = lift (Fail.fail s) +#endif + instance MonadCatch m => MonadCatch (WebT m) where catch action handle = WebT $ catch (unWebT action) (unWebT . handle)