From 571ec80d164503b248f1428c0e2644ef909acaf6 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 1 Apr 2011 11:32:57 +0300 Subject: [PATCH] Fake conversion to monad-control --- Yesod/Handler.hs | 22 +++++++++++----------- Yesod/Widget.hs | 4 ++-- yesod-core.cabal | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Yesod/Handler.hs b/Yesod/Handler.hs index ab576cf6..0d547cde 100644 --- a/Yesod/Handler.hs +++ b/Yesod/Handler.hs @@ -125,8 +125,8 @@ import Control.Failure (Failure (failure)) import Text.Hamlet -import Control.Monad.IO.Peel (MonadPeelIO) -- FIXME monad-control -import Control.Monad.Trans.Peel (MonadTransPeel (peel), liftPeel) +import Control.Monad.IO.Control (MonadControlIO) +import Control.Monad.Trans.Control (MonadTransControl, liftControl, control) import qualified Data.Map as Map import qualified Data.ByteString as S import Data.ByteString (ByteString) @@ -230,7 +230,7 @@ newtype GGHandler sub master m a = GHandler { unGHandler :: GHInner sub master m a } - deriving (Functor, Applicative, Monad, MonadIO, MonadPeelIO) + deriving (Functor, Applicative, Monad, MonadIO, MonadControlIO) instance MonadTrans (GGHandler s m) where lift = GHandler . lift . lift . lift . lift @@ -243,7 +243,7 @@ data GHState = GHState , ghsIdent :: Int } -type GHInner s m monad = +type GHInner s m monad = -- FIXME collapse the stack ReaderT (HandlerData s m) ( ErrorT HandlerContents ( WriterT (Endo [Header]) ( @@ -742,14 +742,14 @@ newIdent = GHandler $ lift $ lift $ lift $ do liftIOHandler :: MonadIO mo => GGHandler sub master IO a -> GGHandler sub master mo a -liftIOHandler x = do - k <- peel - join $ liftIO $ k x +liftIOHandler x = error "FIXME liftIOHandler" {- do + k <- control + join $ liftIO $ k x -} -instance MonadTransPeel (GGHandler s m) where - peel = GHandler $ do - k <- liftPeel $ liftPeel $ liftPeel peel - return $ liftM GHandler . k . unGHandler +instance MonadTransControl (GGHandler s m) where + liftControl = error "FIXME liftControl for GGHandler" {-GHandler $ do + k <- liftControl $ liftControl $ liftControl control + return $ liftM GHandler . k . unGHandler -} -- | Redirect to a POST resource. -- diff --git a/Yesod/Widget.hs b/Yesod/Widget.hs index 67fd439c..41cddc8e 100644 --- a/Yesod/Widget.hs +++ b/Yesod/Widget.hs @@ -50,13 +50,13 @@ import Yesod.Internal import Control.Monad (liftM) import Data.Text (Text) -import Control.Monad.IO.Peel (MonadPeelIO) +import Control.Monad.IO.Control (MonadControlIO) -- | A generic widget, allowing specification of both the subsite and master -- site datatypes. This is basically a large 'WriterT' stack keeping track of -- dependencies along with a 'StateT' to track unique identifiers. newtype GGWidget s m monad a = GWidget { unGWidget :: GWInner m monad a } -- FIXME remove s - deriving (Functor, Applicative, Monad, MonadIO, MonadPeelIO) + deriving (Functor, Applicative, Monad, MonadIO, MonadControlIO) instance MonadTrans (GGWidget s m) where lift = GWidget . lift diff --git a/yesod-core.cabal b/yesod-core.cabal index e5b15f8e..50258068 100644 --- a/yesod-core.cabal +++ b/yesod-core.cabal @@ -43,7 +43,7 @@ library , old-locale >= 1.0.0.2 && < 1.1 , failure >= 0.1 && < 0.2 , containers >= 0.2 && < 0.5 - , monad-peel >= 0.1 && < 0.2 + , monad-control >= 0.2 && < 0.3 , enumerator >= 0.4.7 && < 0.5 , cookie >= 0.2 && < 0.3 , blaze-html >= 0.4 && < 0.5