From 2c1236652ebe5e34d6f2e3acc4f1d2d1cb6a7c82 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Sun, 1 Nov 2015 16:49:21 -0500 Subject: [PATCH] Fixes hlint suggestions --- src/PostgREST/Auth.hs | 2 +- src/PostgREST/PgStructure.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PostgREST/Auth.hs b/src/PostgREST/Auth.hs index efc391664..80f13a3f3 100644 --- a/src/PostgREST/Auth.hs +++ b/src/PostgREST/Auth.hs @@ -50,7 +50,7 @@ claimsToSQL = map setVar . toList In case there is any problem decoding the JWT it returns Nothing. -} jwtClaims :: Text -> Text -> Maybe JWT.ClaimsMap -jwtClaims secret input = JWT.unregisteredClaims <$> JWT.claims <$> decoded +jwtClaims secret input = JWT.unregisteredClaims . JWT.claims <$> decoded where decoded = JWT.decodeAndVerifySignature (JWT.secret secret) input diff --git a/src/PostgREST/PgStructure.hs b/src/PostgREST/PgStructure.hs index 5b1aa6eb5..d7e1710db 100644 --- a/src/PostgREST/PgStructure.hs +++ b/src/PostgREST/PgStructure.hs @@ -172,7 +172,7 @@ allRelations = do ) |] let simpleRelations = foldr (addParentRelation.relationFromRow) [] rels - links = join $ map (combinations 2) $ filter ((>=1).length) $ groupWith groupFn $ filter ( (==Child). relType) simpleRelations + links = join $ map (combinations 2) $ filter (not . null) $ groupWith groupFn $ filter ( (==Child). relType) simpleRelations return $ simpleRelations ++ mapMaybe link2Relation links where groupFn :: Relation -> Text