Use Seq as base monad in the validator

It is more natural to implement the logic: try to apply each rule to
each node.
This commit is contained in:
2020-09-14 07:49:33 +02:00
parent 08998dbd93
commit 4c10ce9204
11 changed files with 123 additions and 137 deletions

View File

@ -121,11 +121,11 @@ spec = do
describe "definition" $
it "indents block strings in arguments" $
let arguments = [Argument "message" (String "line1\nline2")]
field = Field Nothing "field" arguments [] [] $ Location 0 0
let location = Location 0 0
arguments = [Argument "message" (String "line1\nline2") location]
field = Field Nothing "field" arguments [] [] location
operation = DefinitionOperation
$ SelectionSet (pure $ FieldSelection field)
$ Location 0 0
$ SelectionSet (pure $ FieldSelection field) location
in definition pretty operation `shouldBe` [r|{
field(message: """
line1

View File

@ -75,7 +75,7 @@ spec = describe "Lexer" $ do
parse dollar "" "$" `shouldParse` "$"
runBetween parens `shouldSucceedOn` "()"
parse spread "" "..." `shouldParse` "..."
parse colon "" ":" `shouldParse` ":"
parse colon "" `shouldSucceedOn` ":"
parse equals "" "=" `shouldParse` "="
parse at "" "@" `shouldParse` "@"
runBetween brackets `shouldSucceedOn` "[]"