From 90a5d7b2071e8414948be80dc25120d1189b0674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20Hangh=C3=B8j=20Iversen?= Date: Wed, 7 Aug 2019 22:25:24 +0200 Subject: [PATCH 1/3] Fix issue with inability to parse mandatory types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prior to this commit: λ parseWith (pure mempty) type_ "[B!]!" Done "!" (TypeList ...) With this commit we now have: λ parseWith (pure mempty) type_ "[B!]!" Done "" (TypeNonNull ...) The important thing to note here is that previous "[B!]!" was parsed as a list type (not a non-null type), but all the input was not consumed as expected. This means that whatever parser comes after would start by looking at the exclamation point, which belongs to the type. --- src/GraphQL/Internal/Syntax/Parser.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GraphQL/Internal/Syntax/Parser.hs b/src/GraphQL/Internal/Syntax/Parser.hs index 5513116..ad40354 100644 --- a/src/GraphQL/Internal/Syntax/Parser.hs +++ b/src/GraphQL/Internal/Syntax/Parser.hs @@ -212,8 +212,8 @@ directive = AST.Directive -- * Type Reference type_ :: Parser AST.GType -type_ = AST.TypeList <$> listType - <|> AST.TypeNonNull <$> nonNullType +type_ = AST.TypeNonNull <$> nonNullType + <|> AST.TypeList <$> listType <|> AST.TypeNamed <$> namedType "type_ error!" From 22e31b5239087b113b135252b69c37b81945970e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20Hangh=C3=B8j=20Iversen?= Date: Mon, 12 Aug 2019 12:03:38 +0200 Subject: [PATCH 2/3] Enable language extensions by default Enabled extensions: DerivingStrategies and StandaloneDeriving --- package.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.yaml b/package.yaml index 8653d3e..3139b26 100644 --- a/package.yaml +++ b/package.yaml @@ -21,9 +21,11 @@ extra-source-files: # NB the "redundant constraints" warning is a GHC bug: https://ghc.haskell.org/trac/ghc/ticket/11099 ghc-options: -Wall -fno-warn-redundant-constraints default-extensions: + - DerivingStrategies - NoImplicitPrelude - OverloadedStrings - RecordWildCards + - StandaloneDeriving - TypeApplications dependencies: From 4273aad9de1b5fa81613c63ee7b12278a46e056b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20Hangh=C3=B8j=20Iversen?= Date: Mon, 26 Aug 2019 13:26:15 +0200 Subject: [PATCH 3/3] Increase test coverage tolerance --- scripts/hpc-ratchet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/hpc-ratchet b/scripts/hpc-ratchet index df77fe3..14ab078 100755 --- a/scripts/hpc-ratchet +++ b/scripts/hpc-ratchet @@ -37,7 +37,7 @@ Each item represents the number of "things" we are OK with not being covered. COVERAGE_TOLERANCE = { ALTERNATIVES: 154, BOOLEANS: 8, - EXPRESSIONS: 1366, + EXPRESSIONS: 1367, LOCAL_DECLS: 10, TOP_LEVEL_DECLS: 673, }