web-routes-regular 0.18.2 → 0.19.0
raw patch · 2 files changed
+10/−9 lines, 2 filesdep +textdep ~web-routesPVP ok
version bump matches the API change (PVP)
Dependencies added: text
Dependency ranges changed: web-routes
API changes (from Hackage documentation)
- Web.Routes.Regular: lower :: String -> String
- Web.Routes.Regular: gtoPathSegments :: GToURL f => f a -> [String]
+ Web.Routes.Regular: gtoPathSegments :: GToURL f => f a -> [Text]
Files
- Web/Routes/Regular.hs +4/−7
- web-routes-regular.cabal +6/−2
Web/Routes/Regular.hs view
@@ -2,14 +2,14 @@ module Web.Routes.Regular where import Control.Applicative hiding ((<|>))-import Data.Char (toLower)+import Data.Text (Text, pack, toLower) import Generics.Regular import Text.ParserCombinators.Parsec.Prim import Text.ParserCombinators.Parsec.Combinator import Web.Routes.PathInfo (PathInfo(fromPathSegments, toPathSegments), URLParser, segment) class GToURL f where- gtoPathSegments :: f a -> [String]+ gtoPathSegments :: f a -> [Text] gfromPathSegments :: URLParser (f a) instance PathInfo a => GToURL (K a) where @@ -36,12 +36,9 @@ gtoPathSegments (S x) = gtoPathSegments x gfromPathSegments = S <$> gfromPathSegments -lower :: String -> String-lower = map toLower- instance forall c f. (Constructor c, GToURL f) => GToURL (C c f) where- gtoPathSegments c@(C x) = (lower $ conName c) : gtoPathSegments x+ gtoPathSegments c@(C x) = (toLower $ pack $ conName c) : gtoPathSegments x gfromPathSegments = let constr = undefined :: C c f r- in do segment (lower $ conName constr) <|> segment (conName constr)+ in do segment (toLower $ pack $ conName constr) <|> segment (pack $ conName constr) C <$> gfromPathSegments
web-routes-regular.cabal view
@@ -1,5 +1,5 @@ Name: web-routes-regular-Version: 0.18.2+Version: 0.19.0 License: BSD3 License-File: LICENSE Author: jeremy@seereason.com@@ -12,7 +12,11 @@ Build-type: Simple Library- Build-Depends: base >= 4 && < 5, parsec >= 2 && <4, regular, web-routes >= 0.18+ Build-Depends: base >= 4 && < 5, + parsec >= 2 && <4, + regular, + text,+ web-routes >= 0.26 Exposed-Modules: Web.Routes.Regular source-repository head