urlpath 1.0.0 → 1.1.0
raw patch · 2 files changed
+12/−2 lines, 2 files
Files
- src/Data/Url/Types.hs +10/−1
- urlpath.cabal +2/−1
src/Data/Url/Types.hs view
@@ -6,12 +6,12 @@ , FlexibleInstances , MultiParamTypeClasses , DeriveFunctor- , StandaloneDeriving #-} module Data.Url.Types where import Data.String+import Data.List import Data.Monoid import Data.Monoid.Textual (TextualMonoid) import Data.Functor.Identity@@ -58,6 +58,15 @@ (<&>) (UrlString !t !p) !kv = UrlString t $ p ++ [kv] infixl 8 <&>+++fromRoute :: ( TextualMonoid a ) =>+ ([a], [(a, a)])+ -> UrlString a+fromRoute (l,qs) = UrlString (intercalate' "/" l) qs+ where+ intercalate' c [s] = s+ intercalate' c (s:ss) = s <> c <> intercalate' c ss -- | Render the Url String flatly - without anything prepended to the target.
urlpath.cabal view
@@ -1,5 +1,5 @@ Name: urlpath-Version: 1.0.0+Version: 1.1.0 Author: Athan Clark <athan.clark@gmail.com> Maintainer: Athan Clark <athan.clark@gmail.com> License: MIT@@ -99,6 +99,7 @@ , mtl , text , transformers+ , monoid-subclasses benchmark bench type: exitcode-stdio-1.0