nested-routes 8.0.2 → 8.1.0
raw patch · 2 files changed
+8/−8 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Web.Routes.Nested: match :: (Monad m, Match xs' xs childContent resultContent) => UrlChunks xs -> childContent -> RouterT resultContent sec m ()
+ Web.Routes.Nested: match :: (Monad m, Match xs' xs (MiddlewareT m) resultContent) => UrlChunks xs -> MiddlewareT m -> RouterT resultContent sec m ()
- Web.Routes.Nested: matchAny :: (Monad m) => content -> RouterT content sec m ()
+ Web.Routes.Nested: matchAny :: (Monad m) => MiddlewareT m -> RouterT (MiddlewareT m) sec m ()
- Web.Routes.Nested: matchHere :: (Monad m) => content -> RouterT content sec m ()
+ Web.Routes.Nested: matchHere :: (Monad m) => MiddlewareT m -> RouterT (MiddlewareT m) sec m ()
Files
- nested-routes.cabal +2/−2
- src/Web/Routes/Nested.hs +6/−6
nested-routes.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 3cba23da53b9eb7a5d98a85f0bdb6467464282f0dfcd97e2e82f38e36ffd4b6b+-- hash: d5b889e06120570dab096e91ef8f5126ec32f55d8ac4d7ab46a1eeb7024e3767 name: nested-routes-version: 8.0.2+version: 8.1.0 synopsis: Declarative, compositional Wai responses description: This library attempts to make it easier to write nice Wai response handlers by giving us a Sinatra/ <https://hackage.haskell.org/package/scotty Scotty>-like syntax for declaring HTTP-verb oriented routes, in addition to file-extension handling and rose-tree like composition. Not only do we have literal route specification, like <https://hackage.haskell.org/package/scotty Scotty> & <https://hackage.haskell.org/package/spock Spock>, but we can also embed <https://hackage.haskell.org/package/attoparsec Attoparsec> parsers and <https://hackage.haskell.org/package/regex-compat Regular Expressions> /directly/ in our routes, with our handlers reflecting their results. category: Web
src/Web/Routes/Nested.hs view
@@ -135,9 +135,9 @@ -- by a predicate with 'matchGroup', -- then we would need another level of arity /before/ the @Double@. match :: ( Monad m- , Match xs' xs childContent resultContent+ , Match xs' xs (MiddlewareT m) resultContent ) => UrlChunks xs -- ^ Predicative path to match against- -> childContent -- ^ The response to send+ -> MiddlewareT m -- ^ The response to send -> RouterT resultContent sec m () match !ts !vl = tell' $ Tries (singleton ts vl)@@ -149,8 +149,8 @@ -- | Create a handle for the /current/ route - an alias for @\h -> match o_ h@. matchHere :: ( Monad m- ) => content -- ^ The response to send- -> RouterT content sec m ()+ ) => MiddlewareT m -- ^ The response to send+ -> RouterT (MiddlewareT m) sec m () matchHere = match origin_ {-# INLINEABLE matchHere #-}@@ -160,8 +160,8 @@ -- use this for a catch-all at some level in their routes, something -- like a @not-found 404@ page is useful. matchAny :: ( Monad m- ) => content -- ^ The response to send- -> RouterT content sec m ()+ ) => MiddlewareT m -- ^ The response to send+ -> RouterT (MiddlewareT m) sec m () matchAny !vl = tell' $ Tries mempty (singleton origin_ vl)