reroute 0.3.0.2 → 0.3.1.0
raw patch · 2 files changed
+16/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Web.Routing.AbstractRouter: swapMonad :: (Monad n, Monad m, AbstractRouter r) => (forall b. n b -> m b) -> RegistryT r middleware reqTypes n a -> RegistryT r middleware reqTypes m a
Files
- reroute.cabal +1/−1
- src/Web/Routing/AbstractRouter.hs +15/−0
reroute.cabal view
@@ -1,5 +1,5 @@ name: reroute-version: 0.3.0.2+version: 0.3.1.0 synopsis: abstract implementation of typed and untyped web routing description: abstraction over how urls with/without parameters are mapped to their corresponding handlers homepage: http://github.com/agrafix/reroute
src/Web/Routing/AbstractRouter.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE RankNTypes #-} module Web.Routing.AbstractRouter where import Control.Applicative@@ -85,6 +86,20 @@ childSt = parentSt (a, parentSt', middleware') <- lift $ runRWST subReg childBasePath childSt+ put parentSt'+ tell middleware'+ return a++swapMonad ::+ (Monad n, Monad m, AbstractRouter r)+ => (forall b. n b -> m b)+ -> RegistryT r middleware reqTypes n a+ -> RegistryT r middleware reqTypes m a+swapMonad liftLower (RegistryT subReg) =+ do parentSt <- get+ basePath <- ask+ (a, parentSt', middleware') <-+ lift $ liftLower $ runRWST subReg basePath parentSt put parentSt' tell middleware' return a