Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

hlint and warnings clean

  • Loading branch information...
commit 4a3404dc92db0000c92e3518e405c77d653eb7ed 1 parent a7013ba
@singpolyma authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 routeGenerator.hs
View
9 routeGenerator.hs
@@ -37,7 +37,7 @@ emitRoutes rs = do
showRoute r =
"\t\tRoute {\n" ++
"\t\t\trhPieces = " ++
- show ((Static (method r)):(pieces r)) ++
+ show (Static (method r) : pieces r) ++
",\n" ++
"\t\t\trhHasMulti = " ++
@@ -57,13 +57,13 @@ emitRoutes rs = do
piecesAp pieces = concat $ fst $ foldr (\p (ps,c) -> case p of
Dynamic -> ((" `ap` (fromPathPiece val" ++ show c ++ ")"):ps, c+1)
Static _ -> (ps, c)
- ) ([],0) pieces
+ ) ([],0::Int) pieces
piecesPattern pieces = intercalate ":" $ ("_":) $ fst $
foldr (\p (ps,c) -> case p of
Dynamic -> (("val" ++ show c):ps, c+1)
Static _ -> ("_":ps, c)
- ) (["_"],0) pieces
+ ) (["_"],0::Int) pieces
parser :: Parser [Route]
parser = many1 $ do
@@ -87,9 +87,10 @@ parser = many1 $ do
_ <- char '/'
option Nothing (fmap Just piece)
piece = dynamic <|> static
- static = fmap (Static) (takeWhile1 (\x -> x /= '/' && x /= '*' && not (isSpace x)))
+ static = fmap Static (takeWhile1 (\x -> x /= '/' && x /= '*' && not (isSpace x)))
dynamic = char ':' >> return Dynamic
+main :: IO ()
main = do
[input, mod] <- getArgs
Right routes <- fmap (parseOnly parser) $ T.readFile input
Please sign in to comment.
Something went wrong with that request. Please try again.