Closed zhujinxuan closed 5 years ago
Currently, our AST.Value is defined as
data Value = ValueVariable Variable | ValueInt Int32 .... | ValueObject ObjectValue | ValueNull deriving (Eq, Show)
However, it becomes difficult for https://github.com/haskell-graphql/graphql-api/issues/206, because we cannot define a symbol that
_value :: Value -> Int _value :: Value -> ObjectValue -- conflicting type
Perhaps it is better to define Value as
data Value a = Value { __value :: a , position :: PositionInfo } | ValueNull {position :: PositionInfo}
Then we can type the _value as
_value :: Value a ->a
and it can also reduce a lot of boilerplate pattern in value related functions.
Currently, our AST.Value is defined as
However, it becomes difficult for https://github.com/haskell-graphql/graphql-api/issues/206, because we cannot define a symbol that
Perhaps it is better to define Value as
Then we can type the _value as
and it can also reduce a lot of boilerplate pattern in value related functions.