nested-routes 8.1.0 → 8.2.0
raw patch · 2 files changed
+17/−22 lines, 2 filesdep +nested-routesdep −HSetdep −composition-extradep ~poly-aritydep ~pred-setdep ~pred-triePVP ok
version bump matches the API change (PVP)
Dependencies added: nested-routes
Dependencies removed: HSet, composition-extra
Dependency ranges changed: poly-arity, pred-set, pred-trie, wai-middleware-content-type, wai-middleware-verbs, wai-transformers
API changes (from Hackage documentation)
- Web.Routes.Nested: match :: (Monad m, Match xs' xs (MiddlewareT m) resultContent) => UrlChunks xs -> MiddlewareT m -> RouterT resultContent sec m ()
+ Web.Routes.Nested: match :: (Monad m, Match xs' xs childContent resultContent) => UrlChunks xs -> childContent -> RouterT resultContent sec m ()
- Web.Routes.Nested: matchAny :: (Monad m) => MiddlewareT m -> RouterT (MiddlewareT m) sec m ()
+ Web.Routes.Nested: matchAny :: (Monad m) => childContent -> RouterT childContent sec m ()
- Web.Routes.Nested: matchHere :: (Monad m) => MiddlewareT m -> RouterT (MiddlewareT m) sec m ()
+ Web.Routes.Nested: matchHere :: (Monad m) => childContent -> RouterT childContent sec m ()
Files
- nested-routes.cabal +11/−16
- src/Web/Routes/Nested.hs +6/−6
nested-routes.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: d5b889e06120570dab096e91ef8f5126ec32f55d8ac4d7ab46a1eeb7024e3767+-- hash: c5052b8557dda01bdd0835fdee96270827420d90308a2f409b2f64c317f8e3d4 name: nested-routes-version: 8.1.0+version: 8.2.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@@ -64,21 +64,15 @@ Spec Web.Routes.NestedSpec Web.Routes.NestedSpec.Basic- Web.Routes.Nested- Web.Routes.Nested.Match- Web.Routes.Nested.Types Paths_nested_routes hs-source-dirs: test- src- ghc-options: -Wall+ ghc-options: -Wall -threaded -rtsopts -Wall -with-rtsopts=-N build-depends:- HSet- , attoparsec+ attoparsec , base , bifunctors , bytestring- , composition-extra , errors , exceptions , extractable-singleton@@ -89,9 +83,10 @@ , http-types , monad-control-aligned , mtl- , poly-arity- , pred-set- , pred-trie+ , nested-routes+ , poly-arity >=0.0.7+ , pred-set >=0.0.1+ , pred-trie >=0.5.1 , regex-compat , semigroups , tasty@@ -100,7 +95,7 @@ , transformers , tries , unordered-containers- , wai-middleware-content-type- , wai-middleware-verbs- , wai-transformers+ , wai-middleware-content-type >=0.5.0.1+ , wai-middleware-verbs >=0.3.1+ , wai-transformers >=0.0.7 default-language: Haskell2010
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 (MiddlewareT m) resultContent+ , Match xs' xs childContent resultContent ) => UrlChunks xs -- ^ Predicative path to match against- -> MiddlewareT m -- ^ The response to send+ -> childContent -- ^ 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- ) => MiddlewareT m -- ^ The response to send- -> RouterT (MiddlewareT m) sec m ()+ ) => childContent -- ^ The response to send+ -> RouterT childContent 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- ) => MiddlewareT m -- ^ The response to send- -> RouterT (MiddlewareT m) sec m ()+ ) => childContent -- ^ The response to send+ -> RouterT childContent sec m () matchAny !vl = tell' $ Tries mempty (singleton origin_ vl)