From 7692693aaecb9b29e9af1d55055d4475e2e750af Mon Sep 17 00:00:00 2001 From: Joe Nelson Date: Fri, 23 Oct 2015 10:33:27 -0700 Subject: [PATCH 1/2] Enforce GHC >= 7.10 and fix Stack warnings --- circle.yml | 2 +- postgrest.cabal | 38 ++++++++++++++++++++++++++++--------- src/PostgREST/Auth.hs | 3 --- src/PostgREST/Middleware.hs | 3 --- src/PostgREST/Parsers.hs | 4 ---- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/circle.yml b/circle.yml index 84c32bb12..74c1982c8 100644 --- a/circle.yml +++ b/circle.yml @@ -3,7 +3,7 @@ machine: - createuser --superuser --no-password postgrest_test - createdb -O postgrest_test -U ubuntu postgrest_test ghc: - version: 7.8.3 + version: 7.10.1 dependencies: override: - cabal update diff --git a/postgrest.cabal b/postgrest.cabal index 38f5bf364..d4a01c176 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -25,7 +25,7 @@ executable postgrest main-is: PostgREST/Main.hs default-extensions: OverloadedStrings, ScopedTypeVariables, QuasiQuotes default-language: Haskell2010 - build-depends: base >=4.6 && <5 + build-depends: base >= 4.8 && < 5 , postgrest , hasql >= 0.7.3 && < 0.8 , hasql-backend >= 0.4.1 && < 0.5 @@ -57,6 +57,18 @@ executable postgrest , errors , bifunctors hs-source-dirs: src + other-modules: Paths_postgrest + , PostgREST.App + , PostgREST.Auth + , PostgREST.Config + , PostgREST.Error + , PostgREST.Middleware + , PostgREST.Parsers + , PostgREST.PgQuery + , PostgREST.PgStructure + , PostgREST.QueryBuilder + , PostgREST.RangeQuery + , PostgREST.Types library if flag(ci) @@ -111,16 +123,16 @@ library Other-Modules: Paths_postgrest Exposed-Modules: PostgREST.App - , PostgREST.Types - , PostgREST.Parsers - , PostgREST.QueryBuilder , PostgREST.Auth , PostgREST.Config , PostgREST.Error , PostgREST.Middleware + , PostgREST.Parsers , PostgREST.PgQuery , PostgREST.PgStructure + , PostgREST.QueryBuilder , PostgREST.RangeQuery + , PostgREST.Types hs-source-dirs: src Test-Suite spec @@ -133,20 +145,28 @@ Test-Suite spec else ghc-options: -Wall -W -O2 Main-Is: Main.hs - Other-Modules: PostgREST.App - , PostgREST.Types - , PostgREST.Parsers - , PostgREST.QueryBuilder + Other-Modules: Feature.AuthSpec + , Feature.CorsSpec + , Feature.DeleteSpec + , Feature.InsertSpec + , Feature.QuerySpec + , Feature.RangeSpec + , Feature.StructureSpec + , Paths_postgrest + , PostgREST.App , PostgREST.Auth , PostgREST.Config , PostgREST.Error , PostgREST.Middleware + , PostgREST.Parsers , PostgREST.PgQuery , PostgREST.PgStructure + , PostgREST.QueryBuilder , PostgREST.RangeQuery + , PostgREST.Types , Spec , SpecHelper - , Paths_postgrest + , TestTypes Build-Depends: base, hspec == 2.1.*, QuickCheck , hspec-wai, hspec-wai-json , hasql, hasql-backend diff --git a/src/PostgREST/Auth.hs b/src/PostgREST/Auth.hs index 94e36d90b..4bf13dc59 100644 --- a/src/PostgREST/Auth.hs +++ b/src/PostgREST/Auth.hs @@ -18,9 +18,6 @@ module PostgREST.Auth ( , tokenJWT ) where ---line needed for ghc 7.8 -import Data.Functor ((<$>)) - import Data.Aeson (Value (..), Object) import Data.Aeson.Types (emptyObject, emptyArray) import Data.Vector as V (null, head) diff --git a/src/PostgREST/Middleware.hs b/src/PostgREST/Middleware.hs index 90b71a40e..5787ca3a2 100644 --- a/src/PostgREST/Middleware.hs +++ b/src/PostgREST/Middleware.hs @@ -3,9 +3,6 @@ module PostgREST.Middleware where --- needed for ghc 7.8 -import Data.Functor ((<$>)) - import Data.Maybe (fromMaybe, isNothing) import Data.Monoid import Data.Text diff --git a/src/PostgREST/Parsers.hs b/src/PostgREST/Parsers.hs index 235962811..b1f2a77a4 100644 --- a/src/PostgREST/Parsers.hs +++ b/src/PostgREST/Parsers.hs @@ -4,10 +4,6 @@ module PostgREST.Parsers where import Control.Applicative hiding ((<$>)) ---lines needed for ghc 7.8 -import Data.Functor ((<$>)) -import Data.Traversable (traverse) - import Control.Monad (join) import Data.List (delete, find) import Data.Maybe From af15046d3f977f641720827cd1b4dd655b6117ea Mon Sep 17 00:00:00 2001 From: Joe Nelson Date: Fri, 23 Oct 2015 11:08:59 -0700 Subject: [PATCH 2/2] Use newer hspec --- postgrest.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgrest.cabal b/postgrest.cabal index d4a01c176..40140e9ca 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -167,7 +167,7 @@ Test-Suite spec , Spec , SpecHelper , TestTypes - Build-Depends: base, hspec == 2.1.*, QuickCheck + Build-Depends: base, hspec == 2.2.*, QuickCheck , hspec-wai, hspec-wai-json , hasql, hasql-backend , hasql-postgres