packages feed

nested-routes 6.0.0 → 6.0.0.1

raw patch · 4 files changed

+15/−13 lines, 4 filesdep ~wai-middleware-content-typedep ~wai-transformersPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: wai-middleware-content-type, wai-transformers

API changes (from Hackage documentation)

- Web.Routes.Nested.Types.UrlChunks: l_ :: Text -> EitherUrlChunk (Nothing *)
+ Web.Routes.Nested.Types.UrlChunks: l_ :: Text -> EitherUrlChunk Nothing
- Web.Routes.Nested.Types.UrlChunks: o_ :: UrlChunks ([] (Maybe *))
+ Web.Routes.Nested.Types.UrlChunks: o_ :: UrlChunks '[]
- Web.Routes.Nested.Types.UrlChunks: p_ :: (Text, Parser r) -> EitherUrlChunk (Just * r)
+ Web.Routes.Nested.Types.UrlChunks: p_ :: (Text, Parser r) -> EitherUrlChunk (Just r)
- Web.Routes.Nested.Types.UrlChunks: r_ :: (Text, Regex) -> EitherUrlChunk (Just * [String])
+ Web.Routes.Nested.Types.UrlChunks: r_ :: (Text, Regex) -> EitherUrlChunk (Just [String])

Files

examples/Main.hs view
@@ -32,9 +32,9 @@ -- not do anything. authorize :: ( Monad m              ) => Request -> [AuthRole] -> m (Response -> Response, Maybe AuthErr)--- authorize _ _ = return id -- uncomment to force constant authorization-authorize req ss | null ss   = return (id, Nothing)-                 | otherwise = return (id, Just NeedsAuth)+authorize _ _ = return (id, Nothing) -- uncomment to force constant authorization+-- authorize req ss | null ss   = return (id, Nothing)+--                  | otherwise = return (id, Just NeedsAuth)  defApp :: Application defApp _ respond = respond $ textOnlyStatus status404 "404 :("
nested-routes.cabal view
@@ -1,5 +1,5 @@ Name:                   nested-routes-Version:                6.0.0+Version:                6.0.0.1 Author:                 Athan Clark <athan.clark@gmail.com> Maintainer:             Athan Clark <athan.clark@gmail.com> License:                BSD3@@ -56,8 +56,8 @@                       , text                       , transformers                       , tries-                      , wai-transformers-                      , wai-middleware-content-type >= 0.0.3+                      , wai-transformers >= 0.0.3+                      , wai-middleware-content-type >= 0.0.3.1                       , wai-middleware-verbs >= 0.0.4  @@ -104,7 +104,7 @@   Default-Language:     Haskell2010   HS-Source-Dirs:       src                       , examples-  GHC-Options:          -Wall+  GHC-Options:          -Wall -threaded   Main-Is:              Main.hs   Other-Modules:        Web.Routes.Nested                         Web.Routes.Nested.Types
src/Web/Routes/Nested/Types.hs view
@@ -20,8 +20,6 @@   , module Web.Routes.Nested.Types.UrlChunks   ) where -import           Data.Attoparsec.Text-import           Text.Regex import           Web.Routes.Nested.Types.UrlChunks import qualified Data.Text as T import           Data.Trie.Pred
src/Web/Routes/Nested/Types/UrlChunks.hs view
@@ -38,28 +38,32 @@ instance x ~ 'Nothing => IsString (EitherUrlChunk x) where   fromString = literal_ . T.pack ++o_, origin_ :: UrlChunks '[] o_ = origin_  -- | The /Origin/ chunk - the equivalent to @[]@-origin_ :: UrlChunks '[] origin_ = Root ++l_, literal_ :: T.Text -> EitherUrlChunk 'Nothing l_ = literal_  -- | Match against a /Literal/ chunk-literal_ :: T.Text -> EitherUrlChunk 'Nothing literal_ = (:=) ++p_, parse_ :: (T.Text, Parser r) -> EitherUrlChunk ('Just r) p_ = parse_  -- | Match against a /Parsed/ chunk, with <https://hackage.haskell.org/package/attoparsec attoparsec>.-parse_ :: (T.Text, Parser r) -> EitherUrlChunk ('Just r) parse_ (i,q) = (:~) (i, eitherToMaybe . parseOnly q) ++r_, regex_ :: (T.Text, Regex) -> EitherUrlChunk ('Just [String]) r_ = regex_  -- | Match against a /Regular expression/ chunk, with <https://hackage.haskell.org/package/regex-compat regex-compat>.-regex_ :: (T.Text, Regex) -> EitherUrlChunk ('Just [String]) regex_ (i,q) = (:~) (i, matchRegex q . T.unpack)  -- | Match with a predicate against the url chunk directly.