--- happstack-server-7.4.2-orig/src/Happstack/Server/Internal/Monads.hs 2015-03-24 03:34:11.000000000 +1100 +++ happstack-server-7.4.2/src/Happstack/Server/Internal/Monads.hs 2015-04-04 15:20:58.273008986 +1100 @@ -173,7 +173,7 @@ instance MonadTrans (ServerPartT) where lift m = withRequest (\_ -> lift m) -instance (Monad m) => Monoid (ServerPartT m a) where +instance (Monad m, MonadPlus m) => Monoid (ServerPartT m a) where mempty = mzero mappend = mplus @@ -486,7 +486,7 @@ instance MonadTrans WebT where lift = WebT . lift . lift . lift -instance (Monad m) => MonadPlus (WebT m) where +instance (Monad m, MonadPlus m) => MonadPlus (WebT m) where -- | Aborts a computation. -- -- This is primarily useful because 'msum' will take an array of @@ -505,7 +505,7 @@ lft (Left r, _) = Left r lft (Right a, f) = Right (a, f) -instance (Monad m) => Monoid (WebT m a) where +instance (Monad m, MonadPlus m) => Monoid (WebT m a) where mempty = mzero mappend = mplus @@ -561,7 +561,7 @@ liftWebT (Just (Right x,f)) = pass (return x)>>= (\a -> return $ Just (Right a,f)) -- | Deprecated: use 'msum'. -multi :: Monad m => [ServerPartT m a] -> ServerPartT m a +multi :: (Monad m, MonadPlus m) => [ServerPartT m a] -> ServerPartT m a multi = msum {-# DEPRECATED multi "Use msum instead" #-} --- happstack-server-7.4.2-orig/src/Happstack/Server/RqData.hs 2015-03-24 03:34:11.000000000 +1100 +++ happstack-server-7.4.2/src/Happstack/Server/RqData.hs 2015-04-04 15:25:15.454830906 +1100 @@ -92,7 +92,7 @@ newtype ReaderError r e a = ReaderError { unReaderError :: ReaderT r (Either e) a } deriving (Functor, Monad, MonadPlus) -instance (Error e) => MonadReader r (ReaderError r e) where +instance (Error e, Monoid e) => MonadReader r (ReaderError r e) where ask = ReaderError ask local f m = ReaderError $ local f (unReaderError m) @@ -157,7 +157,7 @@ rqDataError e = mapRqData ((Left e) `apEither`) (return ()) -- instance (MonadPlus m, MonadIO m, ServerMonad m) => (HasRqData m) where -instance (MonadIO m) => HasRqData (ServerPartT m) where +instance (MonadIO m, MonadPlus m) => HasRqData (ServerPartT m) where askRqEnv = do rq <- askRq mbi <- liftIO $ if ((rqMethod rq == POST) || (rqMethod rq == PUT)) && (isDecodable (ctype rq))