summaryrefslogtreecommitdiff
path: root/Data/GraphQL
diff options
context:
space:
mode:
Diffstat (limited to 'Data/GraphQL')
-rw-r--r--Data/GraphQL/AST.hs2
-rw-r--r--Data/GraphQL/Encoder.hs5
-rw-r--r--Data/GraphQL/Error.hs7
-rw-r--r--Data/GraphQL/Execute.hs4
-rw-r--r--Data/GraphQL/Parser.hs5
-rw-r--r--Data/GraphQL/Schema.hs17
6 files changed, 1 insertions, 39 deletions
diff --git a/Data/GraphQL/AST.hs b/Data/GraphQL/AST.hs
index 99eaa79..98bbe9f 100644
--- a/Data/GraphQL/AST.hs
+++ b/Data/GraphQL/AST.hs
@@ -158,7 +158,7 @@ data InterfaceTypeDefinition = InterfaceTypeDefinition Name [FieldDefinition]
data UnionTypeDefinition = UnionTypeDefinition Name [NamedType]
deriving (Eq,Show)
-data ScalarTypeDefinition = ScalarTypeDefinition Name
+newtype ScalarTypeDefinition = ScalarTypeDefinition Name
deriving (Eq,Show)
data EnumTypeDefinition = EnumTypeDefinition Name [EnumValueDefinition]
diff --git a/Data/GraphQL/Encoder.hs b/Data/GraphQL/Encoder.hs
index 86f090b..a418893 100644
--- a/Data/GraphQL/Encoder.hs
+++ b/Data/GraphQL/Encoder.hs
@@ -1,12 +1,7 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
-- | This module defines a printer for the @GraphQL@ language.
module Data.GraphQL.Encoder where
-#if !MIN_VERSION_base(4,8,0)
-import Control.Applicative ((<$>))
-import Data.Monoid (Monoid, mconcat, mempty)
-#endif
import Data.Monoid ((<>))
import Data.Text (Text, cons, intercalate, pack, snoc)
diff --git a/Data/GraphQL/Error.hs b/Data/GraphQL/Error.hs
index 74f08e4..8c24a81 100644
--- a/Data/GraphQL/Error.hs
+++ b/Data/GraphQL/Error.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module Data.GraphQL.Error (
parseError,
@@ -15,12 +14,6 @@ import Data.Text (Text, pack)
import Control.Arrow ((&&&))
-#if !MIN_VERSION_base(4,8,0)
-import Control.Applicative (Applicative, pure)
-import Data.Foldable (Foldable, concatMap)
-import Prelude hiding (concatMap)
-#endif
-
-- | Wraps a parse error into a list of errors.
parseError :: Applicative f => String -> f Aeson.Value
parseError s =
diff --git a/Data/GraphQL/Execute.hs b/Data/GraphQL/Execute.hs
index 86887ff..a7e3c91 100644
--- a/Data/GraphQL/Execute.hs
+++ b/Data/GraphQL/Execute.hs
@@ -1,11 +1,7 @@
-{-# LANGUAGE CPP #-}
-- | This module provides the function to execute a @GraphQL@ request --
-- according to a 'Schema'.
module Data.GraphQL.Execute (execute) where
-#if !MIN_VERSION_base(4,8,0)
-import Control.Applicative ((<$>))
-#endif
import Control.Applicative (Alternative)
import Data.Maybe (catMaybes)
diff --git a/Data/GraphQL/Parser.hs b/Data/GraphQL/Parser.hs
index 227c9a8..2de09b0 100644
--- a/Data/GraphQL/Parser.hs
+++ b/Data/GraphQL/Parser.hs
@@ -1,14 +1,9 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
-- | This module defines a parser for @GraphQL@ request documents.
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 (isDigit, isSpace)
diff --git a/Data/GraphQL/Schema.hs b/Data/GraphQL/Schema.hs
index 7966392..b8668d9 100644
--- a/Data/GraphQL/Schema.hs
+++ b/Data/GraphQL/Schema.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE LambdaCase #-}
-- | This module provides a representation of a @GraphQL@ Schema in addition to
@@ -23,16 +22,8 @@ module Data.GraphQL.Schema
, Value(..)
) where
-#if !MIN_VERSION_base(4,8,0)
-import Control.Applicative (pure)
-import Control.Arrow (first)
-import Data.Foldable (foldMap)
-import Data.Traversable (traverse)
-import Data.Monoid (Monoid(mempty,mappend))
-#else
import Data.Bifunctor (first)
import Data.Monoid (Alt(Alt,getAlt))
-#endif
import Control.Applicative (Alternative((<|>), empty))
import Data.Maybe (catMaybes)
import Data.Foldable (fold)
@@ -142,11 +133,3 @@ field _ = Nothing
-- | Returns a list of the 'Field's contained in the given 'SelectionSet'.
fields :: SelectionSet -> [Field]
fields = catMaybes . fmap field
-
-#if !MIN_VERSION_base(4,8,0)
-newtype Alt f a = Alt {getAlt :: f a}
-
-instance Alternative f => Monoid (Alt f a) where
- mempty = Alt empty
- Alt x `mappend` Alt y = Alt $ x <|> y
-#endif