From f88948e801d5b12ba7ec3b46bf10cd6e0363ce1a Mon Sep 17 00:00:00 2001 From: Danny Navarro Date: Wed, 16 Sep 2015 10:36:44 +0200 Subject: [PATCH] Support ghc-7.8 --- Data/GraphQL/Parser.hs | 7 ++++++- graphql.cabal | 2 +- stack-7.10.yaml | 5 +++++ stack-7.8.yaml | 5 +++++ stack.yaml | 6 +----- tests/golden.hs | 4 ++++ 6 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 stack-7.10.yaml create mode 100644 stack-7.8.yaml mode change 100644 => 120000 stack.yaml diff --git a/Data/GraphQL/Parser.hs b/Data/GraphQL/Parser.hs index 66d913d..c999004 100644 --- a/Data/GraphQL/Parser.hs +++ b/Data/GraphQL/Parser.hs @@ -1,12 +1,17 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} module Data.GraphQL.Parser where import Prelude hiding (takeWhile) + +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative ((<$>), (<*>), (*>), (<*), (<$), pure) +import Data.Monoid (Monoid, mempty) +#endif import Control.Applicative ((<|>), empty, many, optional) import Control.Monad (when) import Data.Char - import Data.Text (Text, pack) import Data.Attoparsec.Text ( Parser diff --git a/graphql.cabal b/graphql.cabal index d19731c..0a72430 100644 --- a/graphql.cabal +++ b/graphql.cabal @@ -14,7 +14,7 @@ copyright: Copyright (C) 2015 J. Daniel Navarro category: Web build-type: Simple cabal-version: >=1.10 -tested-with: GHC == 7.10 +tested-with: GHC == 7.8, GHC == 7.10 extra-source-files: README.md CHANGELOG.md stack.yaml data-files: tests/data/*.graphql tests/data/*.graphql.golden diff --git a/stack-7.10.yaml b/stack-7.10.yaml new file mode 100644 index 0000000..bee0443 --- /dev/null +++ b/stack-7.10.yaml @@ -0,0 +1,5 @@ +flags: {} +packages: +- '.' +extra-deps: [] +resolver: lts-3.4 diff --git a/stack-7.8.yaml b/stack-7.8.yaml new file mode 100644 index 0000000..809bd2e --- /dev/null +++ b/stack-7.8.yaml @@ -0,0 +1,5 @@ +flags: {} +packages: +- '.' +extra-deps: [] +resolver: lts-2.22 diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index bee0443..0000000 --- a/stack.yaml +++ /dev/null @@ -1,5 +0,0 @@ -flags: {} -packages: -- '.' -extra-deps: [] -resolver: lts-3.4 diff --git a/stack.yaml b/stack.yaml new file mode 120000 index 0000000..177aa94 --- /dev/null +++ b/stack.yaml @@ -0,0 +1 @@ +stack-7.10.yaml \ No newline at end of file diff --git a/tests/golden.hs b/tests/golden.hs index 2323a97..98413eb 100644 --- a/tests/golden.hs +++ b/tests/golden.hs @@ -1,6 +1,10 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Main where +#if !MIN_VERSION_base(4,8,0) +import Control.Applicative ((<$>), (<*>), pure) +#endif import Control.Monad ((>=>)) import Data.Attoparsec.Text (parseOnly) import Data.ByteString.Lazy.Char8 as B8