haskell-graphql / graphql-api

Write type-safe GraphQL services in Haskell
BSD 3-Clause "New" or "Revised" License
406 stars 35 forks source link

[WIP] Adding Position Annotation #205

Closed zhujinxuan closed 5 years ago

zhujinxuan commented 5 years ago

There will be a big change if we want to add position annotation as discussed in https://github.com/haskell-graphql/graphql-api/issues/75

We used to have schema :: a -> AST, then it will be schema :: a -> (Int, Int) -> AST

zhujinxuan commented 5 years ago
screenshot 2018-11-02 01 21 15

Sees that the coverage test fails because we do not test position in record explicitly. I am not sure whether we need to test this?

Update: Commit from d004986 the coverage test with ticks overlay.

zhujinxuan commented 5 years ago

Close this PR because adding position directly to AST is not a good idea. I am checking about Free or CoFree to describe the position-annotated parser. (https://www.reddit.com/r/haskell/comments/4x22f9/labelling_ast_nodes_with_locations/)