From f3b8d9b74ccd24521a9f15fe4bd47ab30830abfb Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 14 Jul 2019 05:58:05 +0200 Subject: [PATCH] Make all exports explicit --- src/Language/GraphQL.hs | 5 +++- src/Language/GraphQL/AST.hs | 33 +++++++++++++++++++-- src/Language/GraphQL/AST/Core.hs | 10 ++++++- src/Language/GraphQL/AST/Transform.hs | 4 ++- src/Language/GraphQL/Encoder.hs | 5 +++- src/Language/GraphQL/Error.hs | 14 ++++----- src/Language/GraphQL/Execute.hs | 4 ++- src/Language/GraphQL/Parser.hs | 4 ++- src/Language/GraphQL/Schema.hs | 42 +++++++++++++-------------- src/Language/GraphQL/Trans.hs | 4 ++- stack.yaml | 2 +- stack.yaml.lock | 6 ++-- tests/Test/StarWars/Data.hs | 18 +++++++++++- tests/Test/StarWars/Schema.hs | 8 ++++- 14 files changed, 116 insertions(+), 43 deletions(-) diff --git a/src/Language/GraphQL.hs b/src/Language/GraphQL.hs index 74052d9..7a0163d 100644 --- a/src/Language/GraphQL.hs +++ b/src/Language/GraphQL.hs @@ -1,5 +1,8 @@ -- | This module provides the functions to parse and execute @GraphQL@ queries. -module Language.GraphQL where +module Language.GraphQL + ( graphql + , graphqlSubs + ) where import Control.Monad.IO.Class (MonadIO) import qualified Data.Text as T diff --git a/src/Language/GraphQL/AST.hs b/src/Language/GraphQL/AST.hs index 618bd4b..e0a30e6 100644 --- a/src/Language/GraphQL/AST.hs +++ b/src/Language/GraphQL/AST.hs @@ -2,8 +2,37 @@ -- . -- -- Target AST for Parser. - -module Language.GraphQL.AST where +module Language.GraphQL.AST + ( Alias + , Argument(..) + , Arguments + , DefaultValue + , Definition(..) + , Directive(..) + , Directives + , Document + , Field(..) + , FragmentDefinition(..) + , FragmentName + , FragmentSpread(..) + , InlineFragment(..) + , ListValue + , Name + , NonNullType(..) + , ObjectField(..) + , ObjectValue + , OperationDefinition(..) + , OperationType(..) + , Selection(..) + , SelectionSet + , SelectionSetOpt + , Type(..) + , TypeCondition + , Value(..) + , Variable + , VariableDefinition(..) + , VariableDefinitions + ) where import Data.Int (Int32) import Data.List.NonEmpty (NonEmpty) diff --git a/src/Language/GraphQL/AST/Core.hs b/src/Language/GraphQL/AST/Core.hs index be432a8..eb4e505 100644 --- a/src/Language/GraphQL/AST/Core.hs +++ b/src/Language/GraphQL/AST/Core.hs @@ -1,5 +1,13 @@ -- | This is the AST meant to be executed. -module Language.GraphQL.AST.Core where +module Language.GraphQL.AST.Core + ( Argument(..) + , Document + , Field(..) + , Name + , ObjectField(..) + , Operation(..) + , Value(..) + ) where import Data.Int (Int32) import Data.List.NonEmpty (NonEmpty) diff --git a/src/Language/GraphQL/AST/Transform.hs b/src/Language/GraphQL/AST/Transform.hs index 22a9c4c..94c3792 100644 --- a/src/Language/GraphQL/AST/Transform.hs +++ b/src/Language/GraphQL/AST/Transform.hs @@ -1,5 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} -module Language.GraphQL.AST.Transform where +module Language.GraphQL.AST.Transform + ( document + ) where import Control.Applicative (empty) import Control.Monad ((<=<)) diff --git a/src/Language/GraphQL/Encoder.hs b/src/Language/GraphQL/Encoder.hs index de5e2bb..266f314 100644 --- a/src/Language/GraphQL/Encoder.hs +++ b/src/Language/GraphQL/Encoder.hs @@ -1,6 +1,9 @@ {-# LANGUAGE OverloadedStrings #-} -- | This module defines a printer for the @GraphQL@ language. -module Language.GraphQL.Encoder where +module Language.GraphQL.Encoder + ( document + , spaced + ) where import Data.Foldable (fold) import Data.Monoid ((<>)) diff --git a/src/Language/GraphQL/Error.hs b/src/Language/GraphQL/Error.hs index c2338b1..8289f79 100644 --- a/src/Language/GraphQL/Error.hs +++ b/src/Language/GraphQL/Error.hs @@ -1,12 +1,12 @@ {-# LANGUAGE OverloadedStrings #-} module Language.GraphQL.Error - ( parseError - , CollectErrsT - , addErr - , addErrMsg - , runCollectErrs - , runAppendErrs - ) where + ( parseError + , CollectErrsT + , addErr + , addErrMsg + , runCollectErrs + , runAppendErrs + ) where import qualified Data.Aeson as Aeson import Data.Text (Text, pack) diff --git a/src/Language/GraphQL/Execute.hs b/src/Language/GraphQL/Execute.hs index 7416167..2a1ff97 100644 --- a/src/Language/GraphQL/Execute.hs +++ b/src/Language/GraphQL/Execute.hs @@ -2,7 +2,9 @@ -- | This module provides the function to execute a @GraphQL@ request -- -- according to a 'Schema'. -module Language.GraphQL.Execute (execute) where +module Language.GraphQL.Execute + ( execute + ) where import Control.Monad.IO.Class (MonadIO) import qualified Data.List.NonEmpty as NE diff --git a/src/Language/GraphQL/Parser.hs b/src/Language/GraphQL/Parser.hs index 215da73..a773a05 100644 --- a/src/Language/GraphQL/Parser.hs +++ b/src/Language/GraphQL/Parser.hs @@ -1,6 +1,8 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} -module Language.GraphQL.Parser where +module Language.GraphQL.Parser + ( document + ) where import Control.Applicative ( Alternative(..) , optional diff --git a/src/Language/GraphQL/Schema.hs b/src/Language/GraphQL/Schema.hs index 1efdf0d..08b52ce 100644 --- a/src/Language/GraphQL/Schema.hs +++ b/src/Language/GraphQL/Schema.hs @@ -3,27 +3,27 @@ -- | This module provides a representation of a @GraphQL@ Schema in addition to -- functions for defining and manipulating Schemas. module Language.GraphQL.Schema - ( Resolver - , Schema - , Subs - , object - , objectA - , scalar - , scalarA - , enum - , enumA - , resolve - , wrappedEnum - , wrappedEnumA - , wrappedObject - , wrappedObjectA - , wrappedScalar - , wrappedScalarA - -- * AST Reexports - , Field - , Argument(..) - , Value(..) - ) where + ( Resolver + , Schema + , Subs + , object + , objectA + , scalar + , scalarA + , enum + , enumA + , resolve + , wrappedEnum + , wrappedEnumA + , wrappedObject + , wrappedObjectA + , wrappedScalar + , wrappedScalarA + -- * AST Reexports + , Field + , Argument(..) + , Value(..) + ) where import Control.Monad.IO.Class (MonadIO(..)) import Control.Monad.Trans.Class (lift) diff --git a/src/Language/GraphQL/Trans.hs b/src/Language/GraphQL/Trans.hs index f0fcefb..5ca72e9 100644 --- a/src/Language/GraphQL/Trans.hs +++ b/src/Language/GraphQL/Trans.hs @@ -1,4 +1,6 @@ -module Language.GraphQL.Trans where +module Language.GraphQL.Trans + ( ActionT(..) + ) where import Control.Applicative (Alternative(..)) import Control.Monad (MonadPlus(..)) diff --git a/stack.yaml b/stack.yaml index 5909cb4..7ecba39 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-13.27 +resolver: lts-13.28 packages: - '.' extra-deps: [] diff --git a/stack.yaml.lock b/stack.yaml.lock index 7fb2c31..b984045 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -7,6 +7,6 @@ packages: [] snapshots: - completed: size: 500539 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/13/27.yaml - sha256: 690db832392afe55733b4c7023fd29b1b1c660ee42f1fb505b86b07394ca994e - original: lts-13.27 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/13/28.yaml + sha256: cdde1bfb38fdee21c6acb73d506e78f7e12e0a73892adbbbe56374ebef4d3adf + original: lts-13.28 diff --git a/tests/Test/StarWars/Data.hs b/tests/Test/StarWars/Data.hs index 5ceeb82..55ff207 100644 --- a/tests/Test/StarWars/Data.hs +++ b/tests/Test/StarWars/Data.hs @@ -1,5 +1,21 @@ {-# LANGUAGE OverloadedStrings #-} -module Test.StarWars.Data where +module Test.StarWars.Data + ( Character + , appearsIn + , artoo + , getDroid + , getDroid' + , getEpisode + , getFriends + , getHero + , getHeroIO + , getHuman + , id_ + , homePlanet + , name + , secretBackstory + , typeName + ) where import Data.Monoid (mempty) import Control.Applicative ( Alternative(..) diff --git a/tests/Test/StarWars/Schema.hs b/tests/Test/StarWars/Schema.hs index 3cc34fd..101bbdf 100644 --- a/tests/Test/StarWars/Schema.hs +++ b/tests/Test/StarWars/Schema.hs @@ -1,6 +1,12 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} -module Test.StarWars.Schema where +module Test.StarWars.Schema + ( character + , droid + , hero + , human + , schema + ) where import Control.Monad.Trans.Except (throwE) import Control.Monad.Trans.Class (lift)