web-routes-boomerang 0.25.1 → 0.26.0
raw patch · 2 files changed
+8/−7 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.Boomerang: boomerangSite :: ((url -> [(String, String)] -> String) -> url -> a) -> Router url -> Site url a
+ Web.Routes.Boomerang: boomerangSite :: ((url -> [(Text, Maybe Text)] -> Text) -> url -> a) -> Router url -> Site url a
Files
Web/Routes/Boomerang.hs view
@@ -148,13 +148,14 @@ , boomerangSiteRouteT ) where +import Data.Text (Text, pack, unpack) import Text.Boomerang -- (PrinterParser(..), ParserError(..), (:-), condenseErrors, parse1, showParserError, unparse1) import Text.Boomerang.Strings -- (StringsPos(..), isComplete)-import Web.Routes (RouteT(..), Site(..))+import Web.Routes (RouteT(..), Site(..)) type Router url = PrinterParser StringsError [String] () (url :- ()) -boomerangSite :: ((url -> [(String, String)] -> String) -> url -> a) -- ^ handler function+boomerangSite :: ((url -> [(Text, Maybe Text)] -> Text) -> url -> a) -- ^ handler function -> Router url -- ^ the router -> Site url a boomerangSite handler r@(PrinterParser pf sf) =@@ -162,14 +163,13 @@ , formatPathSegments = \url -> case unparseStrings r url of Nothing -> error "formatPathSegments failed to produce a url"- (Just ps) -> (ps, [])- , parsePathSegments = \paths -> mapLeft (showErrors paths) (parseStrings r paths)+ (Just ps) -> (map pack ps, [])+ , parsePathSegments = \paths -> mapLeft (showErrors paths) (parseStrings r $ map unpack paths) } where mapLeft f = either (Left . f) Right showErrors paths err = (showParserError showPos err) ++ " while parsing " ++ show paths showPos (MajorMinorPos s c) = "path segment " ++ show (s + 1) ++ ", character " ++ show c- boomerangSiteRouteT :: (url -> RouteT url m a) -- ^ handler function -> Router url -- ^ the router
web-routes-boomerang.cabal view
@@ -1,5 +1,5 @@ Name: web-routes-boomerang-Version: 0.25.1+Version: 0.26.0 License: BSD3 License-File: LICENSE Author: jeremy@seereason.com@@ -15,7 +15,8 @@ Build-Depends: base >= 4 && < 5, boomerang, mtl,- web-routes+ text == 0.11.*,+ web-routes >= 0.26 Exposed-Modules: Web.Routes.Boomerang Extensions: TypeOperators