Fix for GHC-7.8.4

This commit is contained in:
Danny Navarro 2016-01-26 13:53:15 +01:00
parent 78e0d871d5
commit b72cfc097a
2 changed files with 8 additions and 4 deletions

View File

@ -3,7 +3,7 @@
module Data.GraphQL.Execute where module Data.GraphQL.Execute where
#if !MIN_VERSION_base(4,8,0) #if !MIN_VERSION_base(4,8,0)
import Control.Applicative (Applicative) import Control.Applicative ((<$>), Applicative)
#endif #endif
import qualified Data.Aeson as Aeson import qualified Data.Aeson as Aeson

View File

@ -1,13 +1,15 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedLists #-} {-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE OverloadedStrings #-}
module Test.StarWars where module Test.StarWars where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
#endif
import Control.Applicative ((<|>), liftA2) import Control.Applicative ((<|>), liftA2)
import Data.Maybe (catMaybes) import Data.Maybe (catMaybes)
-- import Data.Functor.Identity (Identity(..))
import Data.Text (Text) import Data.Text (Text)
-- import Data.Aeson (ToJSON(toJSON), genericToJSON, defaultOptions)
import qualified Data.Aeson as Aeson import qualified Data.Aeson as Aeson
import Data.Attoparsec.Text (parseOnly) import Data.Attoparsec.Text (parseOnly)
@ -47,6 +49,8 @@ query (InputField "human") = OutputResolver human
query (InputField "droid") = OutputResolver droid query (InputField "droid") = OutputResolver droid
query _ = OutputError query _ = OutputError
-- TODO: Extract helper function from next 3 functions.
hero :: Resolver hero :: Resolver
hero (InputList (InputScalar (ScalarInt ep) : inputFields)) = hero (InputList (InputScalar (ScalarInt ep) : inputFields)) =
maybe OutputError (\char -> OutputList $ (`characterOutput` char) <$> fields inputFields) $ getHero ep maybe OutputError (\char -> OutputList $ (`characterOutput` char) <$> fields inputFields) $ getHero ep