From 066d120c0e348f08bea3d2238ff354e384fad058 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Sat, 31 Oct 2015 12:01:26 -0400 Subject: [PATCH 1/2] Changes stack resolver to nightly. --- stack.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/stack.yaml b/stack.yaml index 2dc4d15b6..fb06a970b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,11 +1,7 @@ flags: {} packages: - '.' -extra-deps: +extra-deps: - Ranged-sets-0.3.0 - packdeps-0.4.1 - - hspec-2.2.0 - - hspec-core-2.2.0 - - hspec-discover-2.2.0 - - hspec-expectations-0.7.2 -resolver: lts-3.10 +resolver: nightly-2015-10-27 From 2c1236652ebe5e34d6f2e3acc4f1d2d1cb6a7c82 Mon Sep 17 00:00:00 2001 From: Diogo Biazus Date: Sun, 1 Nov 2015 16:49:21 -0500 Subject: [PATCH 2/2] 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