diff options
Diffstat (limited to 'Data')
| -rw-r--r-- | Data/GraphQL/AST.hs | 4 | ||||
| -rw-r--r-- | Data/GraphQL/Parser.hs | 17 |
2 files changed, 11 insertions, 10 deletions
diff --git a/Data/GraphQL/AST.hs b/Data/GraphQL/AST.hs index 0a09671..422ce9e 100644 --- a/Data/GraphQL/AST.hs +++ b/Data/GraphQL/AST.hs @@ -61,8 +61,8 @@ type TypeCondition = NamedType -- * Values data Value = ValueVariable Variable - | ValueInt Int -- TODO: Should this be `Integer`? - | ValueFloat Double -- TODO: Should this be `Scientific`? + | ValueInt Int + | ValueFloat Double | ValueBoolean Bool | ValueString Text | ValueEnum Name diff --git a/Data/GraphQL/Parser.hs b/Data/GraphQL/Parser.hs index c999004..fa8c532 100644 --- a/Data/GraphQL/Parser.hs +++ b/Data/GraphQL/Parser.hs @@ -148,16 +148,17 @@ typeCondition = namedType -- explicit types use the `typedValue` parser. value :: Parser Value value = ValueVariable <$> variable - -- TODO: Handle arbitrary precision. - <|> ValueInt <$> tok (signed decimal) - <|> ValueFloat <$> tok (signed double) - <|> ValueBoolean <$> bool + -- TODO: Handle maxBound, Int32 in spec. + <|> ValueInt <$> tok (signed decimal) + -- There is a stock `parser` for double but not for float. + <|> ValueFloat <$> tok (signed double) + <|> ValueBoolean <$> bool -- TODO: Handle escape characters, unicode, etc - <|> ValueString <$> quotes name + <|> ValueString <$> quotes name -- `true` and `false` have been tried before - <|> ValueEnum <$> name - <|> ValueList <$> listValue - <|> ValueObject <$> objectValue + <|> ValueEnum <$> name + <|> ValueList <$> listValue + <|> ValueObject <$> objectValue -- Notice it can be empty listValue :: Parser ListValue |
