diff options
| author | Tom Hunger <tehunger@gmail.com> | 2016-12-08 23:34:46 +0000 |
|---|---|---|
| committer | Tom Hunger <tehunger@gmail.com> | 2016-12-09 00:03:20 +0000 |
| commit | 87c92e9d6eed3cf7a45f9df8da45c3a5689d28e1 (patch) | |
| tree | e29701fb022d8defc91b5b6e29e419455c6f479a /graphql.cabal | |
| parent | 61f0a06096cc05ebc008db7e4647390f9a066a44 (diff) | |
| download | graphql-87c92e9d6eed3cf7a45f9df8da45c3a5689d28e1.tar.gz | |
Parse number as scientific and interpret meaning separately.
The current parser will fail parsing floats because it parses an int,
and then stumbles on the dot.
To fix I interpret the value with the scientific library which already
is a dependency through attoparsec, so we're not introducing any extra
downloads or compiling.
I think this is still subtly wrong because "10.0" will be parsed as
ValueInt, but because input argument ints are allowed to be coerced
into doubles (according to the spec) this is probably acceptable.
Diffstat (limited to 'graphql.cabal')
| -rw-r--r-- | graphql.cabal | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/graphql.cabal b/graphql.cabal index b73e259..d330abd 100644 --- a/graphql.cabal +++ b/graphql.cabal @@ -34,7 +34,8 @@ library attoparsec >= 0.10.4.0, base >= 4.7 && < 5, text >= 0.11.3.1, - unordered-containers >= 0.2.5.0 + unordered-containers >= 0.2.5.0, + scientific >=0.3.1 && <0.4 if impl(ghc >= 8.0) ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances else |
