Permalink
Browse files

monad-peel

  • Loading branch information...
snoyberg committed Dec 16, 2010
1 parent 676a6aa commit 604ca3dc365177709dea008ef23426879669b33c
Showing with 11 additions and 29 deletions.
  1. +2 −2 Yesod.hs
  2. +2 −12 Yesod/Handler.hs
  3. +2 −11 Yesod/Widget.hs
  4. +5 −4 yesod.cabal
View
@@ -13,7 +13,7 @@ module Yesod
, Application
, lift
, liftIO
- , MonadInvertIO
+ , MonadPeelIO
, mempty
, showIntegral
, readIntegral
@@ -41,7 +41,7 @@ import Yesod.Hamlet
import Control.Monad.Trans.Class (lift)
import Control.Monad.IO.Class (liftIO)
import Data.Monoid (mempty)
-import Control.Monad.Invert (MonadInvertIO)
+import Control.Monad.IO.Peel (MonadPeelIO)
showIntegral :: Integral a => a -> String
showIntegral x = show (fromIntegral x :: Integer)
View
@@ -112,8 +112,7 @@ import Control.Failure (Failure (failure))
import Text.Hamlet
-import Control.Monad.Invert (MonadInvertIO (..))
-import Control.Monad (liftM)
+import Control.Monad.IO.Peel (MonadPeelIO)
import qualified Data.Map as Map
import qualified Data.ByteString.Char8 as S8
@@ -210,7 +209,7 @@ newtype GHandler sub master a =
GHandler
{ unGHandler :: GHInner sub master a
}
- deriving (Functor, Applicative, Monad, MonadIO)
+ deriving (Functor, Applicative, Monad, MonadIO, MonadPeelIO)
type GHInner s m =
ReaderT (HandlerData s m) (
@@ -222,15 +221,6 @@ type GHInner s m =
type SessionMap = Map.Map String String
-instance MonadInvertIO (GHandler s m) where
- newtype InvertedIO (GHandler s m) a =
- InvGHandlerIO
- { runInvGHandlerIO :: InvertedIO (GHInner s m) a
- }
- type InvertedArg (GHandler s m) = (HandlerData s m, (SessionMap, ()))
- invertIO = liftM (fmap InvGHandlerIO) . invertIO . unGHandler
- revertIO f = GHandler $ revertIO $ liftM runInvGHandlerIO . f
-
type Endo a = a -> a
-- | An extension of the basic WAI 'W.Application' datatype to provide extra
View
@@ -46,15 +46,15 @@ import Control.Monad.IO.Class (MonadIO)
import Control.Monad.Trans.Class (lift)
import Yesod.Internal
-import Control.Monad.Invert (MonadInvertIO (..))
+import Control.Monad.IO.Peel (MonadPeelIO)
import Control.Monad (liftM)
import qualified Data.Map as Map
-- | 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 GWidget s m a = GWidget { unGWidget :: GWInner s m a }
- deriving (Functor, Applicative, Monad, MonadIO)
+ deriving (Functor, Applicative, Monad, MonadIO, MonadPeelIO)
type GWInner sub master =
WriterT (Body (Route master)) (
WriterT (Last Title) (
@@ -69,15 +69,6 @@ type GWInner sub master =
instance Monoid (GWidget sub master ()) where
mempty = return ()
mappend x y = x >> y
-instance MonadInvertIO (GWidget s m) where
- newtype InvertedIO (GWidget s m) a =
- InvGWidgetIO
- { runInvGWidgetIO :: InvertedIO (GWInner s m) a
- }
- type InvertedArg (GWidget s m) =
- (Int, (HandlerData s m, (Map.Map String String, ())))
- invertIO = liftM (fmap InvGWidgetIO) . invertIO . unGWidget
- revertIO f = GWidget $ revertIO $ liftM runInvGWidgetIO . f
instance HamletValue (GWidget s m ()) where
newtype HamletMonad (GWidget s m ()) a =
View
@@ -1,5 +1,5 @@
name: yesod
-version: 0.6.8
+version: 0.7.0
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
@@ -36,7 +36,7 @@ library
, text >= 0.5 && < 0.12
, template-haskell >= 2.4 && < 2.6
, web-routes-quasi >= 0.6.2 && < 0.7
- , hamlet >= 0.5.1 && < 0.7
+ , hamlet >= 0.6 && < 0.7
, blaze-builder >= 0.2.1 && < 0.3
, transformers >= 0.2 && < 0.3
, clientsession >= 0.4.0 && < 0.5
@@ -45,15 +45,16 @@ library
, cereal >= 0.2 && < 0.4
, base64-bytestring >= 0.1 && < 0.2
, old-locale >= 1.0.0.2 && < 1.1
- , persistent >= 0.3.0 && < 0.4
- , neither >= 0.1.0 && < 0.2
+ , persistent >= 0.4 && < 0.5
+ , neither >= 0.2 && < 0.3
, network >= 2.2.1.5 && < 2.4
, email-validate >= 0.2.5 && < 0.3
, web-routes >= 0.23 && < 0.24
, xss-sanitize >= 0.2.3 && < 0.3
, data-default >= 0.2 && < 0.3
, failure >= 0.1 && < 0.2
, containers >= 0.2 && < 0.5
+ , monad-peel >= 0.1 && < 0.2
exposed-modules: Yesod
Yesod.Content
Yesod.Dispatch

0 comments on commit 604ca3d

Please sign in to comment.