From 3b0a076c3f67fe2a8dd88c79a3f16af1871f26bf Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Sat, 21 Nov 2015 16:37:17 +0100 Subject: [PATCH] hlint. --- servant-purescript/HLint.hs | 1 + servant-purescript/src/Servant/PureScript.hs | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/servant-purescript/HLint.hs b/servant-purescript/HLint.hs index b4a45942..9012d21b 100644 --- a/servant-purescript/HLint.hs +++ b/servant-purescript/HLint.hs @@ -7,3 +7,4 @@ import "hint" HLint.Dollar import "hint" HLint.Generalise ignore "Redundant bracket" = Domains.Rest.Client +ignore "Use mappend" diff --git a/servant-purescript/src/Servant/PureScript.hs b/servant-purescript/src/Servant/PureScript.hs index e26bbde0..f583442c 100644 --- a/servant-purescript/src/Servant/PureScript.hs +++ b/servant-purescript/src/Servant/PureScript.hs @@ -57,7 +57,7 @@ generatePSModule' -> ST -- ^ Name of PureScript module -> [F.Req] -- ^ List of AJAX requests to render in module -> ST -- ^ Rendered PureScript module -generatePSModule' settings mname reqs = T.unlines $ +generatePSModule' settings mname reqs = T.unlines [ "module " <> mname <> " where" , "" , "import Prelude" @@ -84,7 +84,7 @@ generatePS settings req = ajaxRequest args = captures <> queryArgs <> body <> fmap (fst . snd) headerArgs captures :: [ST] - captures = fmap (F.captureArg) . filter F.isCapture $ req ^. F.reqUrl . F.path + captures = fmap F.captureArg . filter F.isCapture $ req ^. F.reqUrl . F.path queryArgs :: [ST] queryArgs = fmap ((<>) "query" . view F.argName) queryParams @@ -109,9 +109,9 @@ generatePS settings req = ajaxRequest wrapHeaders :: [(T.Text, T.Text)] -> [(T.Text, (T.Text, F.HeaderArg))] -> ST wrapHeaders ihs hs = "[" <> - (T.intercalate ", " (concat $ + T.intercalate ", " (concat $ [wrapImplicitHeader <$> ihs | not $ null ihs] ++ - [wrapHeader <$> hs | not $ null hs])) <> + [wrapHeader <$> hs | not $ null hs]) <> "]" wrapHeader :: (T.Text, (T.Text, F.HeaderArg)) -> ST @@ -134,8 +134,7 @@ generatePS settings req = ajaxRequest (" , url = " <> urlString) : (" , headers = " <> wrapHeaders implicitHeaderArgs headerArgs) : [" , content = Just body" | req ^. F.reqBody] ++ - " }" : - [] + [" }"] where typeSig :: ST typeSig = T.concat