From 67bebf853ca5a248358ea1854124a46b70c677cd Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 1 Feb 2020 20:46:35 +0100 Subject: Replace MonadIO constraint with just Monad And make the tests use Identity instead of IO. --- src/Language/GraphQL.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Language/GraphQL.hs') diff --git a/src/Language/GraphQL.hs b/src/Language/GraphQL.hs index 952f8ac..57c8bf1 100644 --- a/src/Language/GraphQL.hs +++ b/src/Language/GraphQL.hs @@ -4,7 +4,6 @@ module Language.GraphQL , graphqlSubs ) where -import Control.Monad.IO.Class (MonadIO) import qualified Data.Aeson as Aeson import Data.List.NonEmpty (NonEmpty) import qualified Data.Text as T @@ -16,7 +15,7 @@ import Text.Megaparsec (parse) -- | If the text parses correctly as a @GraphQL@ query the query is -- executed using the given 'Schema.Resolver's. -graphql :: MonadIO m +graphql :: Monad m => NonEmpty (Schema.Resolver m) -- ^ Resolvers. -> T.Text -- ^ Text representing a @GraphQL@ request document. -> m Aeson.Value -- ^ Response. @@ -25,7 +24,7 @@ graphql = flip graphqlSubs mempty -- | If the text parses correctly as a @GraphQL@ query the substitution is -- applied to the query and the query is then executed using to the given -- 'Schema.Resolver's. -graphqlSubs :: MonadIO m +graphqlSubs :: Monad m => NonEmpty (Schema.Resolver m) -- ^ Resolvers. -> Schema.Subs -- ^ Variable substitution function. -> T.Text -- ^ Text representing a @GraphQL@ request document. -- cgit v1.2.3