Permalink
Browse files

PartialURI

  • Loading branch information...
1 parent a5b93ab commit 94f639f8d24d6c1007fa40e763742e7853f1b1d4 @singpolyma committed Oct 16, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 routeGenerator.hs
View
@@ -69,7 +69,7 @@ emitPathHelpers rs nArgs = mapM_ emitPathHelper rs
T.putStr (target r)
putStr "Path "
putStr (unwords args)
- putStr " = Network.URI.URI \"\" Nothing ('/' : Data.List.intercalate \"/\" (["
+ putStr " = Network.URI.Partial.fromURI $ Network.URI.URI \"\" Nothing (Data.List.intercalate \"/\" (["
putStr $ intercalate ", " $ snd $ foldr (\p (n,xs) -> case p of
Dynamic -> (n-1, (escapeURI ++ " $ Web.PathPieces.toPathPiece arg" ++ show n):xs)
Static s -> (n, show (doEscapeURI s) : xs)
@@ -197,6 +197,7 @@ main = do
putStrLn "import qualified Network.URI (URI(..), escapeURIString, isReserved, isUnescapedInURI)"
putStrLn "import qualified Data.Text (unpack)"
putStrLn "import qualified Web.PathPieces (toPathPiece, toPathMultiPiece)"
+ putStrLn "import qualified Network.URI.Partial"
putStrLn ""

0 comments on commit 94f639f

Please sign in to comment.