From 0cc63f89f359c096820358b8c5d8fc026c0ea0e0 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 10:06:09 -0700 Subject: [PATCH 01/12] Assign newtype declarations --- src/Language/Haskell/Assignment.hs | 12 +- src/Language/Haskell/Syntax.hs | 9 ++ ...lgebraic-datatype-declarations.diffA-B.txt | 13 ++- ...lgebraic-datatype-declarations.diffB-A.txt | 13 ++- .../haskell/corpus/newtype-declaration.A.hs | 6 + .../haskell/corpus/newtype-declaration.B.hs | 6 + .../corpus/newtype-declaration.diffA-B.txt | 108 ++++++++++++++++++ .../corpus/newtype-declaration.diffB-A.txt | 108 ++++++++++++++++++ .../corpus/newtype-declaration.parseA.txt | 95 +++++++++++++++ .../corpus/newtype-declaration.parseB.txt | 95 +++++++++++++++ .../haskell/corpus/type-synonyms.diffA-B.txt | 14 +-- .../haskell/corpus/type-synonyms.diffB-A.txt | 34 +++--- 12 files changed, 481 insertions(+), 32 deletions(-) create mode 100644 test/fixtures/haskell/corpus/newtype-declaration.A.hs create mode 100644 test/fixtures/haskell/corpus/newtype-declaration.B.hs create mode 100644 test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt create mode 100644 test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt create mode 100644 test/fixtures/haskell/corpus/newtype-declaration.parseA.txt create mode 100644 test/fixtures/haskell/corpus/newtype-declaration.parseB.txt diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index ecede26b7..8daa36dd6 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -58,6 +58,7 @@ type Syntax = '[ , Syntax.ListConstructor , Syntax.Module , Syntax.ModuleExport + , Syntax.NewType , Syntax.Pragma , Syntax.QualifiedModuleIdentifier , Syntax.QualifiedTypeConstructorIdentifier @@ -169,6 +170,7 @@ expressionChoices = [ , listType , moduleExport , moduleIdentifier + , newType , operator , parenthesizedTypePattern , pragma @@ -297,6 +299,14 @@ moduleExport = makeTerm <$> symbol ModuleExport <*> children (Syntax.ModuleExpor moduleIdentifier :: Assignment moduleIdentifier = makeTerm <$> symbol ModuleIdentifier <*> (Syntax.Identifier . Name.name <$> source) +newConstructor :: Assignment +newConstructor = makeTerm <$> symbol NewConstructor <*> children (Declaration.Constructor <$> (context' <|> emptyTerm) <*> typeConstructor <*> typeParameters) + +newType :: Assignment +newType = makeTerm <$> symbol NewtypeDeclaration <*> children (Syntax.NewType <$> (context' <|> emptyTerm) <*> typeLeft <*> newConstructor <*> (derivingClause <|> emptyTerm)) + where + typeLeft = makeTerm <$> location <*> manyTermsTill expression (symbol NewConstructor) + operator :: Assignment operator = typeOperator <|> constructorOperator <|> variableOperator @@ -369,7 +379,7 @@ type'' = makeTerm <*> children (Syntax.Type <$> expression <*> typeParameters <*> (kindSignature <|> emptyTerm)) typeParameters :: Assignment -typeParameters = makeTerm <$> location <*> (Type.TypeParameters <$> (manyTermsTill expression (symbol Annotation) <|> many expression)) +typeParameters = makeTerm <$> location <*> (Type.TypeParameters <$> (manyTermsTill expression (symbol Annotation) <|> manyTerm expression)) typePattern :: Assignment typePattern = makeTerm <$> symbol TypePattern <*> children (Syntax.TypePattern <$> expressions) diff --git a/src/Language/Haskell/Syntax.hs b/src/Language/Haskell/Syntax.hs index c2e67ff7d..7a5839ae3 100644 --- a/src/Language/Haskell/Syntax.hs +++ b/src/Language/Haskell/Syntax.hs @@ -343,3 +343,12 @@ instance Ord1 ScopedTypeVariables where liftCompare = genericLiftCompare instance Show1 ScopedTypeVariables where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ScopedTypeVariables + +data NewType a = NewType { newTypeContext :: a, newTypeLeft :: a, newTypeRight :: a, newTypeDeriving :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 NewType where liftEq = genericLiftEq +instance Ord1 NewType where liftCompare = genericLiftCompare +instance Show1 NewType where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable NewType diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt index 7e6851132..9c76f340f 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt @@ -75,11 +75,6 @@ { (Identifier) ->(Identifier) } (TypeParameters)) - (Constructor - (Empty) - { (Identifier) - ->(Identifier) } - (TypeParameters)) {+(Constructor {+(Empty)+} {+(Identifier)+} @@ -92,6 +87,14 @@ {+(Empty)+} {+(Identifier)+} {+(TypeParameters)+})+} + {+(Constructor + {+(Empty)+} + {+(Identifier)+} + {+(TypeParameters)+})+} + {-(Constructor + {-(Empty)-} + {-(Identifier)-} + {-(TypeParameters)-})-} {-(Constructor {-(Empty)-} {-(Identifier)-} diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt index 22d4479c0..6e1cf626b 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt @@ -75,11 +75,10 @@ { (Identifier) ->(Identifier) } (TypeParameters)) - (Constructor - (Empty) - { (Identifier) - ->(Identifier) } - (TypeParameters)) + {+(Constructor + {+(Empty)+} + {+(Identifier)+} + {+(TypeParameters)+})+} {+(Constructor {+(Empty)+} {+(Identifier)+} @@ -97,6 +96,10 @@ {-(Empty)-} {-(Identifier)-} {-(TypeParameters)-})-} + {-(Constructor + {-(Empty)-} + {-(Identifier)-} + {-(TypeParameters)-})-} {-(Constructor {-(Empty)-} {-(Identifier)-} diff --git a/test/fixtures/haskell/corpus/newtype-declaration.A.hs b/test/fixtures/haskell/corpus/newtype-declaration.A.hs new file mode 100644 index 000000000..b957e38a4 --- /dev/null +++ b/test/fixtures/haskell/corpus/newtype-declaration.A.hs @@ -0,0 +1,6 @@ +newtype N = N Int +newtype Show a => N = N a +newtype Age = Age { unAge :: Maybe Int } +newtype Bar a (b :: [* -> *]) c = Foo (a b c) +newtype N = N Int deriving Show +newtype N = N a deriving (Eq, Ord, Enum, Bounded, Show, Read) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.B.hs b/test/fixtures/haskell/corpus/newtype-declaration.B.hs new file mode 100644 index 000000000..6c3bc2b44 --- /dev/null +++ b/test/fixtures/haskell/corpus/newtype-declaration.B.hs @@ -0,0 +1,6 @@ +newtype O = O Int +newtype Show a => O = O a +newtype Karage = Karage { unKarage :: Maybe Int } +newtype Foo a (b :: [* -> *]) c = Bar (a b c) +newtype O = O Int deriving Show +newtype O = O a deriving (Eq, Ord, Enum, Bounded, Show, Read) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt b/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt new file mode 100644 index 000000000..603e1f191 --- /dev/null +++ b/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt @@ -0,0 +1,108 @@ +(Module + (Empty) + (Statements + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Identifier))) + (Empty)) + (NewType + (Context' + (Class + (Identifier) + (TypeParameters + (Identifier)))) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Identifier))) + (Empty)) + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Statements + (Field + (Statements + { (Identifier) + ->(Identifier) }) + (Type + (Identifier) + (TypeParameters + (Identifier)) + (Empty)))))) + (Empty)) + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) } + (Identifier) + (AnnotatedTypeVariable + (Identifier) + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Identifier)) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Statements + (Identifier) + (Identifier) + (Identifier)))) + (Empty)) + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Identifier))) + (Deriving + (Identifier))) + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Identifier))) + (Deriving + (Identifier) + (Identifier) + (Identifier) + (Identifier) + (Identifier) + (Identifier))))) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt b/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt new file mode 100644 index 000000000..603e1f191 --- /dev/null +++ b/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt @@ -0,0 +1,108 @@ +(Module + (Empty) + (Statements + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Identifier))) + (Empty)) + (NewType + (Context' + (Class + (Identifier) + (TypeParameters + (Identifier)))) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Identifier))) + (Empty)) + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Statements + (Field + (Statements + { (Identifier) + ->(Identifier) }) + (Type + (Identifier) + (TypeParameters + (Identifier)) + (Empty)))))) + (Empty)) + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) } + (Identifier) + (AnnotatedTypeVariable + (Identifier) + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Identifier)) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Statements + (Identifier) + (Identifier) + (Identifier)))) + (Empty)) + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Identifier))) + (Deriving + (Identifier))) + (NewType + (Empty) + (Statements + { (Identifier) + ->(Identifier) }) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (Identifier))) + (Deriving + (Identifier) + (Identifier) + (Identifier) + (Identifier) + (Identifier) + (Identifier))))) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt b/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt new file mode 100644 index 000000000..3a72e4da7 --- /dev/null +++ b/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt @@ -0,0 +1,95 @@ +(Module + (Empty) + (Statements + (NewType + (Empty) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Identifier))) + (Empty)) + (NewType + (Context' + (Class + (Identifier) + (TypeParameters + (Identifier)))) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Identifier))) + (Empty)) + (NewType + (Empty) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Statements + (Field + (Statements + (Identifier)) + (Type + (Identifier) + (TypeParameters + (Identifier)) + (Empty)))))) + (Empty)) + (NewType + (Empty) + (Statements + (Identifier) + (Identifier) + (AnnotatedTypeVariable + (Identifier) + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Statements + (Identifier) + (Identifier) + (Identifier)))) + (Empty)) + (NewType + (Empty) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Identifier))) + (Deriving + (Identifier))) + (NewType + (Empty) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Identifier))) + (Deriving + (Identifier) + (Identifier) + (Identifier) + (Identifier) + (Identifier) + (Identifier))))) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt b/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt new file mode 100644 index 000000000..3a72e4da7 --- /dev/null +++ b/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt @@ -0,0 +1,95 @@ +(Module + (Empty) + (Statements + (NewType + (Empty) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Identifier))) + (Empty)) + (NewType + (Context' + (Class + (Identifier) + (TypeParameters + (Identifier)))) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Identifier))) + (Empty)) + (NewType + (Empty) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Statements + (Field + (Statements + (Identifier)) + (Type + (Identifier) + (TypeParameters + (Identifier)) + (Empty)))))) + (Empty)) + (NewType + (Empty) + (Statements + (Identifier) + (Identifier) + (AnnotatedTypeVariable + (Identifier) + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Statements + (Identifier) + (Identifier) + (Identifier)))) + (Empty)) + (NewType + (Empty) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Identifier))) + (Deriving + (Identifier))) + (NewType + (Empty) + (Statements + (Identifier)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (Identifier))) + (Deriving + (Identifier) + (Identifier) + (Identifier) + (Identifier) + (Identifier) + (Identifier))))) diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt b/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt index 851e81293..66ee7f4e8 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt @@ -52,17 +52,17 @@ (Identifier)) (TypePattern (TupleConstructor))) - (TypeSynonym - (Statements - (Identifier)) - (TypePattern - { (FunctionConstructor) - ->(TupleConstructor) })) {+(TypeSynonym {+(Statements {+(Identifier)+})+} {+(TypePattern - {+(FunctionConstructor)+})+})+} + {+(TupleConstructor)+})+})+} + (TypeSynonym + (Statements + { (Identifier) + ->(Identifier) }) + (TypePattern + (FunctionConstructor))) (TypeSynonym (Statements (Identifier)) diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt index 3b5bdc1dd..95d3b2b10 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt @@ -52,12 +52,11 @@ (Identifier)) (TypePattern (TupleConstructor))) - (TypeSynonym - (Statements - (Identifier)) - (TypePattern - { (TupleConstructor) - ->(FunctionConstructor) })) + {+(TypeSynonym + {+(Statements + {+(Identifier)+})+} + {+(TypePattern + {+(FunctionConstructor)+})+})+} {+(TypeSynonym {+(Statements {+(Identifier)+})+} @@ -115,14 +114,11 @@ {+(Identifier)+} {+(Identifier)+})+})+} {+(Empty)+})+})+})+})+})+} - (TypeSynonym - (Statements - { (Identifier) - ->(Identifier) } - {+(Identifier)+}) - { (TypePattern - {-(FunctionConstructor)-}) - ->(TextElement) }) + {+(TypeSynonym + {+(Statements + {+(Identifier)+} + {+(Identifier)+})+} + {+(TextElement)+})+} {+(TypeSynonym {+(Statements {+(Identifier)+} @@ -171,6 +167,16 @@ {+(Identifier)+} {+(Identifier)+} {+(Identifier)+})+})+})+})+} + {-(TypeSynonym + {-(Statements + {-(Identifier)-})-} + {-(TypePattern + {-(TupleConstructor)-})-})-} + {-(TypeSynonym + {-(Statements + {-(Identifier)-})-} + {-(TypePattern + {-(FunctionConstructor)-})-})-} {-(TypeSynonym {-(Statements {-(Identifier)-})-} From 867170b39a53fe89e823eb4def8e36326eae540a Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 10:13:24 -0700 Subject: [PATCH 02/12] Assign primitive constructor identifiers --- src/Language/Haskell/Assignment.hs | 6 +++++- .../corpus/algebraic-datatype-declarations.A.hs | 2 ++ .../corpus/algebraic-datatype-declarations.B.hs | 3 +++ .../algebraic-datatype-declarations.diffA-B.txt | 15 +++++++++++++++ .../algebraic-datatype-declarations.diffB-A.txt | 15 +++++++++++++++ .../algebraic-datatype-declarations.parseA.txt | 13 +++++++++++++ .../algebraic-datatype-declarations.parseB.txt | 13 +++++++++++++ 7 files changed, 66 insertions(+), 1 deletion(-) diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index 8daa36dd6..876b1d884 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -174,6 +174,7 @@ expressionChoices = [ , operator , parenthesizedTypePattern , pragma + , primitiveConstructorIdentifier , qualifiedModuleIdentifier , qualifiedTypeConstructorIdentifier , quotedName @@ -316,6 +317,9 @@ parenthesizedTypePattern = symbol ParenthesizedTypePattern *> children expressio pragma :: Assignment pragma = makeTerm <$> symbol Pragma <*> (Syntax.Pragma <$> source) +primitiveConstructorIdentifier :: Assignment +primitiveConstructorIdentifier = makeTerm <$> symbol PrimitiveConstructorIdentifier <*> (Syntax.Identifier . Name.name <$> source) + qualifiedModuleIdentifier :: Assignment qualifiedModuleIdentifier = makeTerm <$> symbol QualifiedModuleIdentifier <*> children (Syntax.QualifiedModuleIdentifier <$> someTerm' expression) @@ -335,7 +339,7 @@ strictType :: Assignment strictType = makeTerm' <$> symbol StrictType <*> children ( (inject <$> (Syntax.StrictType <$> typeConstructor <*> typeParameters)) - <|> (inject <$> (Syntax.StrictTypeVariable <$> typeVariableIdentifier))) + <|> (inject <$> (Syntax.StrictTypeVariable <$> expression))) string :: Assignment string = makeTerm <$> symbol String <*> (Literal.TextElement <$> source) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.A.hs b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.A.hs index 0496329da..d3140d0ea 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.A.hs +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.A.hs @@ -26,3 +26,5 @@ data (Eq (f a), Functor f) => N f a = N f a data Foo bar = HasCallStack => Foo bar data Baz foo = Show foo => Baz foo + +data Foo = Foo !Double# diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.B.hs b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.B.hs index d870e1525..609b21b69 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.B.hs +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.B.hs @@ -26,3 +26,6 @@ data (Eq (f a), Applicative f) => N f a = N f a data Foo bar = HasCallStack => Wiz bar data Baz a = Show a => Baz a + + +data Bar = Bar !Double# diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt index 9c76f340f..abb7e7221 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt @@ -423,4 +423,19 @@ (TypeParameters { (Identifier) ->(Identifier) })) + (Empty)) + (Datatype + (Empty) + (Type + { (Identifier) + ->(Identifier) } + (TypeParameters) + (Empty)) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (StrictTypeVariable + (Identifier)))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt index 6e1cf626b..cd68a7f78 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt @@ -420,4 +420,19 @@ (TypeParameters { (Identifier) ->(Identifier) })) + (Empty)) + (Datatype + (Empty) + (Type + { (Identifier) + ->(Identifier) } + (TypeParameters) + (Empty)) + (Constructor + (Empty) + { (Identifier) + ->(Identifier) } + (TypeParameters + (StrictTypeVariable + (Identifier)))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt index 3e9fba65b..8f0e74bc4 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt @@ -354,4 +354,17 @@ (Identifier) (TypeParameters (Identifier))) + (Empty)) + (Datatype + (Empty) + (Type + (Identifier) + (TypeParameters) + (Empty)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (StrictTypeVariable + (Identifier)))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt index 3e9fba65b..8f0e74bc4 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt @@ -354,4 +354,17 @@ (Identifier) (TypeParameters (Identifier))) + (Empty)) + (Datatype + (Empty) + (Type + (Identifier) + (TypeParameters) + (Empty)) + (Constructor + (Empty) + (Identifier) + (TypeParameters + (StrictTypeVariable + (Identifier)))) (Empty)))) From 5d3ece8d693b6dd99482d08749c04622660ac1be Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 10:23:21 -0700 Subject: [PATCH 03/12] Allow multiple contexts (for scoped type variables and type class constraints) for data constructors --- src/Data/Syntax/Declaration.hs | 2 +- src/Language/Go/Assignment.hs | 2 +- src/Language/Haskell/Assignment.hs | 4 +- .../algebraic-datatype-declarations.A.hs | 2 + .../algebraic-datatype-declarations.B.hs | 2 + ...lgebraic-datatype-declarations.diffA-B.txt | 52 +++++++++------- ...lgebraic-datatype-declarations.diffB-A.txt | 61 +++++++++++-------- ...algebraic-datatype-declarations.parseA.txt | 35 ++++++----- ...algebraic-datatype-declarations.parseB.txt | 35 ++++++----- .../corpus/newtype-declaration.diffA-B.txt | 6 -- .../corpus/newtype-declaration.diffB-A.txt | 6 -- .../corpus/newtype-declaration.parseA.txt | 6 -- .../corpus/newtype-declaration.parseB.txt | 6 -- 13 files changed, 112 insertions(+), 107 deletions(-) diff --git a/src/Data/Syntax/Declaration.hs b/src/Data/Syntax/Declaration.hs index c669a538c..1039eb86b 100644 --- a/src/Data/Syntax/Declaration.hs +++ b/src/Data/Syntax/Declaration.hs @@ -194,7 +194,7 @@ instance Evaluatable Data.Syntax.Declaration.Datatype -- | A single constructor in a datatype, or equally a 'struct' in C, Rust, or Swift. -data Constructor a = Constructor { constructorContext :: a, constructorName :: a, constructorFields :: a } +data Constructor a = Constructor { constructorContext :: [a], constructorName :: a, constructorFields :: a } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) instance Eq1 Data.Syntax.Declaration.Constructor where liftEq = genericLiftEq diff --git a/src/Language/Go/Assignment.hs b/src/Language/Go/Assignment.hs index 1d5fa45aa..9496463e8 100644 --- a/src/Language/Go/Assignment.hs +++ b/src/Language/Go/Assignment.hs @@ -316,7 +316,7 @@ sliceType :: Assignment sliceType = makeTerm <$> symbol SliceType <*> children (Type.Slice <$> expression) structType :: Assignment -structType = makeTerm <$> symbol StructType <*> children (Declaration.Constructor <$> emptyTerm <*> emptyTerm <*> expressions) +structType = makeTerm <$> symbol StructType <*> children (Declaration.Constructor <$> pure [] <*> emptyTerm <*> expressions) typeAlias :: Assignment typeAlias = makeTerm <$> symbol TypeAlias <*> children (Declaration.TypeAlias [] <$> expression <*> expression) diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index 876b1d884..bdaac3a8f 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -113,7 +113,7 @@ comment :: Assignment comment = makeTerm <$> symbol Comment <*> (Comment.Comment <$> source) constructor :: Assignment -constructor = (makeTerm <$> symbol DataConstructor <*> children (Declaration.Constructor <$> (context' <|> emptyTerm) <*> typeConstructor <*> typeParameters)) +constructor = (makeTerm <$> symbol DataConstructor <*> children (Declaration.Constructor <$> manyTerm (context' <|> scopedTypeVariables) <*> typeConstructor <*> typeParameters)) <|> (makeTerm <$> symbol RecordDataConstructor <*> children (Syntax.RecordDataConstructor <$> constructorIdentifier <*> fields)) constructorIdentifier :: Assignment @@ -301,7 +301,7 @@ moduleIdentifier :: Assignment moduleIdentifier = makeTerm <$> symbol ModuleIdentifier <*> (Syntax.Identifier . Name.name <$> source) newConstructor :: Assignment -newConstructor = makeTerm <$> symbol NewConstructor <*> children (Declaration.Constructor <$> (context' <|> emptyTerm) <*> typeConstructor <*> typeParameters) +newConstructor = makeTerm <$> symbol NewConstructor <*> children (Declaration.Constructor <$> manyTerm (context' <|> scopedTypeVariables) <*> typeConstructor <*> typeParameters) newType :: Assignment newType = makeTerm <$> symbol NewtypeDeclaration <*> children (Syntax.NewType <$> (context' <|> emptyTerm) <*> typeLeft <*> newConstructor <*> (derivingClause <|> emptyTerm)) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.A.hs b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.A.hs index d3140d0ea..c24e926fd 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.A.hs +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.A.hs @@ -28,3 +28,5 @@ data Foo bar = HasCallStack => Foo bar data Baz foo = Show foo => Baz foo data Foo = Foo !Double# + +data SomeNumber = forall a . Show a => SomeNumber (Number a) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.B.hs b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.B.hs index 609b21b69..d21e205ab 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.B.hs +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.B.hs @@ -29,3 +29,5 @@ data Baz a = Show a => Baz a data Bar = Bar !Double# + +data SomeNumber = forall b . Show b => SomeNumber (Number b) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt index abb7e7221..c29064f55 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt @@ -18,7 +18,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -33,7 +32,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -50,7 +48,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -66,45 +63,37 @@ (TypeParameters) (Empty)) (Constructor - (Empty) - { (Identifier) - ->(Identifier) } - (TypeParameters)) - (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters)) {+(Constructor - {+(Empty)+} {+(Identifier)+} {+(TypeParameters)+})+} {+(Constructor - {+(Empty)+} {+(Identifier)+} {+(TypeParameters)+})+} {+(Constructor - {+(Empty)+} {+(Identifier)+} {+(TypeParameters)+})+} {+(Constructor - {+(Empty)+} + {+(Identifier)+} + {+(TypeParameters)+})+} + {+(Constructor {+(Identifier)+} {+(TypeParameters)+})+} {-(Constructor - {-(Empty)-} {-(Identifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Empty)-} {-(Identifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Empty)-} {-(Identifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Empty)-} + {-(Identifier)-} + {-(TypeParameters)-})-} + {-(Constructor {-(Identifier)-} {-(TypeParameters)-})-} (Empty)) @@ -294,7 +283,6 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Deriving @@ -306,7 +294,6 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Deriving @@ -330,7 +317,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -357,7 +343,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier) @@ -383,7 +368,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier) @@ -432,10 +416,32 @@ (TypeParameters) (Empty)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters (StrictTypeVariable (Identifier)))) + (Empty)) + (Datatype + (Empty) + (Type + (Identifier) + (TypeParameters) + (Empty)) + (Constructor + (ScopedTypeVariables + { (Identifier) + ->(Identifier) }) + (Context' + (Class + (Identifier) + (TypeParameters + { (Identifier) + ->(Identifier) }))) + (Identifier) + (TypeParameters + (Statements + (Identifier) + { (Identifier) + ->(Identifier) }))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt index cd68a7f78..294b62e73 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt @@ -18,7 +18,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -33,7 +32,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -50,7 +48,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -66,42 +63,37 @@ (TypeParameters) (Empty)) (Constructor - (Empty) - { (Identifier) - ->(Identifier) } - (TypeParameters)) - (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters)) {+(Constructor - {+(Empty)+} {+(Identifier)+} {+(TypeParameters)+})+} {+(Constructor - {+(Empty)+} {+(Identifier)+} {+(TypeParameters)+})+} {+(Constructor - {+(Empty)+} {+(Identifier)+} {+(TypeParameters)+})+} - (Constructor - (Empty) - { (Identifier) - ->(Identifier) } - (TypeParameters)) + {+(Constructor + {+(Identifier)+} + {+(TypeParameters)+})+} + {+(Constructor + {+(Identifier)+} + {+(TypeParameters)+})+} + {-(Constructor + {-(Identifier)-} + {-(TypeParameters)-})-} + {-(Constructor + {-(Identifier)-} + {-(TypeParameters)-})-} {-(Constructor - {-(Empty)-} {-(Identifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Empty)-} {-(Identifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Empty)-} {-(Identifier)-} {-(TypeParameters)-})-} (Empty)) @@ -291,7 +283,6 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Deriving @@ -303,7 +294,6 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Deriving @@ -327,7 +317,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -354,7 +343,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier) @@ -380,7 +368,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier) @@ -429,10 +416,32 @@ (TypeParameters) (Empty)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters (StrictTypeVariable (Identifier)))) + (Empty)) + (Datatype + (Empty) + (Type + (Identifier) + (TypeParameters) + (Empty)) + (Constructor + (ScopedTypeVariables + { (Identifier) + ->(Identifier) }) + (Context' + (Class + (Identifier) + (TypeParameters + { (Identifier) + ->(Identifier) }))) + (Identifier) + (TypeParameters + (Statements + (Identifier) + { (Identifier) + ->(Identifier) }))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt index 8f0e74bc4..0af9b78e0 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt @@ -16,7 +16,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -29,7 +28,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (StrictTypeVariable @@ -44,7 +42,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (StrictTypeVariable @@ -58,27 +55,21 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Empty)) @@ -233,7 +224,6 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Deriving @@ -245,7 +235,6 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Deriving @@ -267,7 +256,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -293,7 +281,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier) @@ -318,7 +305,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier) @@ -362,9 +348,28 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (StrictTypeVariable (Identifier)))) + (Empty)) + (Datatype + (Empty) + (Type + (Identifier) + (TypeParameters) + (Empty)) + (Constructor + (ScopedTypeVariables + (Identifier)) + (Context' + (Class + (Identifier) + (TypeParameters + (Identifier)))) + (Identifier) + (TypeParameters + (Statements + (Identifier) + (Identifier)))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt index 8f0e74bc4..0af9b78e0 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt @@ -16,7 +16,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -29,7 +28,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (StrictTypeVariable @@ -44,7 +42,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (StrictTypeVariable @@ -58,27 +55,21 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Empty)) @@ -233,7 +224,6 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Deriving @@ -245,7 +235,6 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters)) (Deriving @@ -267,7 +256,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -293,7 +281,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier) @@ -318,7 +305,6 @@ (Identifier)) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier) @@ -362,9 +348,28 @@ (TypeParameters) (Empty)) (Constructor - (Empty) (Identifier) (TypeParameters (StrictTypeVariable (Identifier)))) + (Empty)) + (Datatype + (Empty) + (Type + (Identifier) + (TypeParameters) + (Empty)) + (Constructor + (ScopedTypeVariables + (Identifier)) + (Context' + (Class + (Identifier) + (TypeParameters + (Identifier)))) + (Identifier) + (TypeParameters + (Statements + (Identifier) + (Identifier)))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt b/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt index 603e1f191..c1b79348c 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt @@ -7,7 +7,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -23,7 +22,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -35,7 +33,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -66,7 +63,6 @@ (Star))))) (Identifier)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -81,7 +77,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -94,7 +89,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters diff --git a/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt b/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt index 603e1f191..c1b79348c 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt @@ -7,7 +7,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -23,7 +22,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -35,7 +33,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -66,7 +63,6 @@ (Star))))) (Identifier)) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -81,7 +77,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters @@ -94,7 +89,6 @@ { (Identifier) ->(Identifier) }) (Constructor - (Empty) { (Identifier) ->(Identifier) } (TypeParameters diff --git a/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt b/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt index 3a72e4da7..e25955c36 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt @@ -6,7 +6,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -20,7 +19,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -30,7 +28,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Statements @@ -58,7 +55,6 @@ (Star))))) (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Statements @@ -71,7 +67,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -82,7 +77,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt b/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt index 3a72e4da7..e25955c36 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt @@ -6,7 +6,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -20,7 +19,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -30,7 +28,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Statements @@ -58,7 +55,6 @@ (Star))))) (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Statements @@ -71,7 +67,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) @@ -82,7 +77,6 @@ (Statements (Identifier)) (Constructor - (Empty) (Identifier) (TypeParameters (Identifier))) From ce8cd489afa800f589385937b719f3cf6313ea11 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 10:33:42 -0700 Subject: [PATCH 04/12] Assign default declarations --- src/Language/Haskell/Assignment.hs | 5 +++++ src/Language/Haskell/Syntax.hs | 9 +++++++++ .../corpus/algebraic-datatype-declarations.diffA-B.txt | 10 ++++++---- .../corpus/algebraic-datatype-declarations.diffB-A.txt | 6 +++--- test/fixtures/haskell/corpus/default-declaration.A.hs | 4 ++++ test/fixtures/haskell/corpus/default-declaration.B.hs | 3 +++ .../haskell/corpus/default-declaration.diffA-B.txt | 9 +++++++++ .../haskell/corpus/default-declaration.diffB-A.txt | 9 +++++++++ .../haskell/corpus/default-declaration.parseA.txt | 7 +++++++ .../haskell/corpus/default-declaration.parseB.txt | 6 ++++++ 10 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 test/fixtures/haskell/corpus/default-declaration.A.hs create mode 100644 test/fixtures/haskell/corpus/default-declaration.B.hs create mode 100644 test/fixtures/haskell/corpus/default-declaration.diffA-B.txt create mode 100644 test/fixtures/haskell/corpus/default-declaration.diffB-A.txt create mode 100644 test/fixtures/haskell/corpus/default-declaration.parseA.txt create mode 100644 test/fixtures/haskell/corpus/default-declaration.parseB.txt diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index bdaac3a8f..f8157d9eb 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -40,6 +40,7 @@ type Syntax = '[ , Syntax.ConstructorOperator , Syntax.Context , Syntax.Context' + , Syntax.DefaultDeclaration , Syntax.Deriving , Syntax.Empty , Syntax.Error @@ -131,6 +132,9 @@ context' = makeTerm <$> symbol Context <*> children (Syntax.Context' <$> manyTer contextPattern :: Assignment contextPattern = symbol ContextPattern *> children type' +defaultDeclaration :: Assignment +defaultDeclaration = makeTerm <$> symbol DefaultDeclaration <*> children (Syntax.DefaultDeclaration <$> manyTerm expression) + derivingClause :: Assignment derivingClause = makeTerm <$> symbol Deriving <*> children (Syntax.Deriving <$> manyTerm typeConstructor) @@ -154,6 +158,7 @@ expressionChoices = [ , constructorIdentifier , constructorOperator , constructorSymbol + , defaultDeclaration , derivingClause , float , functionConstructor diff --git a/src/Language/Haskell/Syntax.hs b/src/Language/Haskell/Syntax.hs index 7a5839ae3..caa5023d5 100644 --- a/src/Language/Haskell/Syntax.hs +++ b/src/Language/Haskell/Syntax.hs @@ -352,3 +352,12 @@ instance Ord1 NewType where liftCompare = genericLiftCompare instance Show1 NewType where liftShowsPrec = genericLiftShowsPrec instance Evaluatable NewType + +newtype DefaultDeclaration a = DefaultDeclaration { defaultDeclarationContent :: [a] } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 DefaultDeclaration where liftEq = genericLiftEq +instance Ord1 DefaultDeclaration where liftCompare = genericLiftCompare +instance Show1 DefaultDeclaration where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable DefaultDeclaration diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt index c29064f55..27342de0b 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt @@ -62,10 +62,6 @@ ->(Identifier) } (TypeParameters) (Empty)) - (Constructor - { (Identifier) - ->(Identifier) } - (TypeParameters)) {+(Constructor {+(Identifier)+} {+(TypeParameters)+})+} @@ -81,6 +77,12 @@ {+(Constructor {+(Identifier)+} {+(TypeParameters)+})+} + {+(Constructor + {+(Identifier)+} + {+(TypeParameters)+})+} + {-(Constructor + {-(Identifier)-} + {-(TypeParameters)-})-} {-(Constructor {-(Identifier)-} {-(TypeParameters)-})-} diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt index 294b62e73..4715e23cb 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt @@ -62,6 +62,9 @@ ->(Identifier) } (TypeParameters) (Empty)) + {+(Constructor + {+(Identifier)+} + {+(TypeParameters)+})+} (Constructor { (Identifier) ->(Identifier) } @@ -78,9 +81,6 @@ {+(Constructor {+(Identifier)+} {+(TypeParameters)+})+} - {+(Constructor - {+(Identifier)+} - {+(TypeParameters)+})+} {-(Constructor {-(Identifier)-} {-(TypeParameters)-})-} diff --git a/test/fixtures/haskell/corpus/default-declaration.A.hs b/test/fixtures/haskell/corpus/default-declaration.A.hs new file mode 100644 index 000000000..a6682bc5d --- /dev/null +++ b/test/fixtures/haskell/corpus/default-declaration.A.hs @@ -0,0 +1,4 @@ +module A where + +default () +default (Integer, Double) diff --git a/test/fixtures/haskell/corpus/default-declaration.B.hs b/test/fixtures/haskell/corpus/default-declaration.B.hs new file mode 100644 index 000000000..4e07769a5 --- /dev/null +++ b/test/fixtures/haskell/corpus/default-declaration.B.hs @@ -0,0 +1,3 @@ +module A where + +default (Double, Integer) diff --git a/test/fixtures/haskell/corpus/default-declaration.diffA-B.txt b/test/fixtures/haskell/corpus/default-declaration.diffA-B.txt new file mode 100644 index 000000000..8592a3917 --- /dev/null +++ b/test/fixtures/haskell/corpus/default-declaration.diffA-B.txt @@ -0,0 +1,9 @@ +(Module + (Identifier) + (Statements + (DefaultDeclaration + {+(Identifier)+} + {+(Identifier)+}) + {-(DefaultDeclaration + {-(Identifier)-} + {-(Identifier)-})-})) diff --git a/test/fixtures/haskell/corpus/default-declaration.diffB-A.txt b/test/fixtures/haskell/corpus/default-declaration.diffB-A.txt new file mode 100644 index 000000000..a323aaec0 --- /dev/null +++ b/test/fixtures/haskell/corpus/default-declaration.diffB-A.txt @@ -0,0 +1,9 @@ +(Module + (Identifier) + (Statements + (DefaultDeclaration + {-(Identifier)-} + {-(Identifier)-}) + {+(DefaultDeclaration + {+(Identifier)+} + {+(Identifier)+})+})) diff --git a/test/fixtures/haskell/corpus/default-declaration.parseA.txt b/test/fixtures/haskell/corpus/default-declaration.parseA.txt new file mode 100644 index 000000000..6b36312ea --- /dev/null +++ b/test/fixtures/haskell/corpus/default-declaration.parseA.txt @@ -0,0 +1,7 @@ +(Module + (Identifier) + (Statements + (DefaultDeclaration) + (DefaultDeclaration + (Identifier) + (Identifier)))) diff --git a/test/fixtures/haskell/corpus/default-declaration.parseB.txt b/test/fixtures/haskell/corpus/default-declaration.parseB.txt new file mode 100644 index 000000000..92660eb69 --- /dev/null +++ b/test/fixtures/haskell/corpus/default-declaration.parseB.txt @@ -0,0 +1,6 @@ +(Module + (Identifier) + (Statements + (DefaultDeclaration + (Identifier) + (Identifier)))) From 9a76a2ea246d189718189f3099269a5d7e56dfa2 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 11:02:24 -0700 Subject: [PATCH 05/12] Bump haskell-tree-sitter --- vendor/haskell-tree-sitter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/haskell-tree-sitter b/vendor/haskell-tree-sitter index c6c149b36..d21ac9e3c 160000 --- a/vendor/haskell-tree-sitter +++ b/vendor/haskell-tree-sitter @@ -1 +1 @@ -Subproject commit c6c149b369cfcda70ecec5d52014ea754ee25fce +Subproject commit d21ac9e3c2730cf785ecee31b3c152cfff559dd2 From 780e5f295b30c601ce607d09d55b80c04de33055 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 12:01:06 -0700 Subject: [PATCH 06/12] Assign tuples --- src/Language/Haskell/Assignment.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index f8157d9eb..1e80cdec9 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -34,6 +34,7 @@ type Syntax = '[ , Literal.Float , Literal.Integer , Literal.TextElement + , Literal.Tuple , Syntax.AllConstructors , Syntax.AnnotatedTypeVariable , Syntax.Class @@ -187,6 +188,7 @@ expressionChoices = [ , star , strictType , string + , tupleType , type' , type'' , typePattern @@ -349,6 +351,9 @@ strictType = makeTerm' string :: Assignment string = makeTerm <$> symbol String <*> (Literal.TextElement <$> source) +tupleType :: Assignment +tupleType = makeTerm <$> symbol TupleType <*> children (Literal.Tuple <$> manyTerm type') + typeClassIdentifier :: Assignment typeClassIdentifier = makeTerm <$> symbol TypeClassIdentifier <*> (Syntax.Identifier . Name.name <$> source) @@ -401,9 +406,10 @@ typeConstructor = constructorIdentifier <|> qualifiedModuleIdentifier <|> qualifiedTypeConstructorIdentifier <|> quotedName + <|> tupleType + <|> tuplingConstructor <|> typeClassIdentifier <|> typeConstructorIdentifier - <|> tuplingConstructor <|> unitConstructor typeSynonymDeclaration :: Assignment From 6f8dff06f8083a2bd1a4a226d3abc0a1194d5e75 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 12:02:13 -0700 Subject: [PATCH 07/12] Assign equality constraints --- src/Language/Haskell/Assignment.hs | 13 +++++++++++-- src/Language/Haskell/Syntax.hs | 10 ++++++++++ test/fixtures/haskell/corpus/type-signatures.A.hs | 9 +++++++++ test/fixtures/haskell/corpus/type-signatures.B.hs | 9 +++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index 1e80cdec9..a87f79ae6 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -45,6 +45,7 @@ type Syntax = '[ , Syntax.Deriving , Syntax.Empty , Syntax.Error + , Syntax.EqualityConstraint , Syntax.Export , Syntax.Field , Syntax.FunctionConstructor @@ -128,10 +129,10 @@ constructorSymbol :: Assignment constructorSymbol = makeTerm <$> symbol ConstructorSymbol <*> (Syntax.Identifier . Name.name <$> source) context' :: Assignment -context' = makeTerm <$> symbol Context <*> children (Syntax.Context' <$> manyTerm (type' <|> contextPattern)) +context' = makeTerm <$> symbol Context <*> children (Syntax.Context' <$> manyTerm expression) contextPattern :: Assignment -contextPattern = symbol ContextPattern *> children type' +contextPattern = makeTerm <$> symbol ContextPattern <*> children (manyTerm expression) defaultDeclaration :: Assignment defaultDeclaration = makeTerm <$> symbol DefaultDeclaration <*> children (Syntax.DefaultDeclaration <$> manyTerm expression) @@ -139,6 +140,12 @@ defaultDeclaration = makeTerm <$> symbol DefaultDeclaration <*> children (Syntax derivingClause :: Assignment derivingClause = makeTerm <$> symbol Deriving <*> children (Syntax.Deriving <$> manyTerm typeConstructor) +equalityConstraint :: Assignment +equalityConstraint = makeTerm <$> symbol EqualityConstraint <*> children (Syntax.EqualityConstraint <$> equalityLhs <*> equalityRhs) + where + equalityLhs = symbol EqualityLhs *> children expression + equalityRhs = symbol EqualityRhs *> children expression + export :: Assignment export = makeTerm <$> symbol Export <*> children (Syntax.Export <$> expressions) @@ -156,11 +163,13 @@ expressionChoices = [ , character , comment , context' + , contextPattern , constructorIdentifier , constructorOperator , constructorSymbol , defaultDeclaration , derivingClause + , equalityConstraint , float , functionConstructor , functionDeclaration diff --git a/src/Language/Haskell/Syntax.hs b/src/Language/Haskell/Syntax.hs index caa5023d5..398ffd07c 100644 --- a/src/Language/Haskell/Syntax.hs +++ b/src/Language/Haskell/Syntax.hs @@ -361,3 +361,13 @@ instance Ord1 DefaultDeclaration where liftCompare = genericLiftCompare instance Show1 DefaultDeclaration where liftShowsPrec = genericLiftShowsPrec instance Evaluatable DefaultDeclaration + +data EqualityConstraint a = EqualityConstraint { equalityConstraintLeft :: a, equalityConstraintRight :: a } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 EqualityConstraint where liftEq = genericLiftEq +instance Ord1 EqualityConstraint where liftCompare = genericLiftCompare +instance Show1 EqualityConstraint where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable EqualityConstraint + diff --git a/test/fixtures/haskell/corpus/type-signatures.A.hs b/test/fixtures/haskell/corpus/type-signatures.A.hs index c04c54a8c..7f05bc1d5 100644 --- a/test/fixtures/haskell/corpus/type-signatures.A.hs +++ b/test/fixtures/haskell/corpus/type-signatures.A.hs @@ -1,3 +1,12 @@ bar :: a -> b -> c -> Int -> Maybe Int bar :: a -> b -> c -> [Int] -> Maybe Int factorial :: Num a => Show a => a -> a + +f :: Ex -> Ex +f :: [Int] -> Int +f :: (Int, Int) -> Maybe Int +f :: a -> B c (D (E g ': h)) -> I [J k] (L m (N (O p ': q))) + +f :: forall a. [a] -> [a] +f :: forall a b. (a, b) -> [a] +apply :: proxy c -> (forall g . c g => g a -> b) -> Union fs a -> b diff --git a/test/fixtures/haskell/corpus/type-signatures.B.hs b/test/fixtures/haskell/corpus/type-signatures.B.hs index 9a4cf1ff6..4390ea80e 100644 --- a/test/fixtures/haskell/corpus/type-signatures.B.hs +++ b/test/fixtures/haskell/corpus/type-signatures.B.hs @@ -1,2 +1,11 @@ foo :: a -> b -> c -> Int -> Maybe Int factorial :: Num a => a -> a + +g :: Ex -> Foo +g :: [Double] -> Int +g :: (Double, Int) -> Maybe Double +g :: b -> B a (D (E g ': h)) -> I [J k] (L m (O (N p ': q))) + +g :: forall a. [a] -> [a] +g :: forall a b. (a, b) -> [a] +apply :: proxy d -> (forall g . d g => g a -> b) -> Union fs a -> b From 646e1c3459814a0e4e100db1970855b54884acf2 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 12:05:17 -0700 Subject: [PATCH 08/12] Be explicit about each identifier type I went through a lot of trouble to make every identifier parsed in `tree-sitter-haskell` as accurate as possible (i.e. type variable identifier vs constructor identifier vs type class identifier). This enables us to keep those distinctions with assignment at the cost of adding more constructors. --- src/Language/Haskell/Assignment.hs | 34 +- src/Language/Haskell/Syntax.hs | 91 +++- ...lgebraic-datatype-declarations.diffA-B.txt | 447 +++++++++--------- ...lgebraic-datatype-declarations.diffB-A.txt | 445 ++++++++--------- ...algebraic-datatype-declarations.parseA.txt | 353 +++++++------- ...algebraic-datatype-declarations.parseB.txt | 353 +++++++------- .../corpus/default-declaration.diffA-B.txt | 10 +- .../corpus/default-declaration.diffB-A.txt | 10 +- .../corpus/default-declaration.parseA.txt | 6 +- .../corpus/default-declaration.parseB.txt | 6 +- .../corpus/gadt-declarations.diffA-B.txt | 132 +++--- .../corpus/gadt-declarations.diffB-A.txt | 132 +++--- .../corpus/gadt-declarations.parseA.txt | 110 ++--- .../corpus/gadt-declarations.parseB.txt | 110 ++--- .../haskell/corpus/literals.diffA-B.txt | 275 ++++++----- .../haskell/corpus/literals.diffB-A.txt | 291 ++++++------ .../haskell/corpus/literals.parseA.txt | 134 +++--- .../haskell/corpus/literals.parseB.txt | 134 +++--- .../corpus/module-declaration1.diffA-B.txt | 4 +- .../corpus/module-declaration1.diffB-A.txt | 4 +- .../corpus/module-declaration1.parseA.txt | 2 +- .../corpus/module-declaration1.parseB.txt | 2 +- .../corpus/module-declaration2.diffA-B.txt | 4 +- .../corpus/module-declaration2.diffB-A.txt | 4 +- .../corpus/module-declaration2.parseA.txt | 2 +- .../corpus/module-declaration2.parseB.txt | 2 +- .../corpus/module-declaration3.diffA-B.txt | 8 +- .../corpus/module-declaration3.diffB-A.txt | 8 +- .../corpus/module-declaration3.parseA.txt | 4 +- .../corpus/module-declaration3.parseB.txt | 4 +- .../corpus/module-declaration4.diffA-B.txt | 10 +- .../corpus/module-declaration4.diffB-A.txt | 10 +- .../corpus/module-declaration4.parseA.txt | 6 +- .../corpus/module-declaration4.parseB.txt | 6 +- .../corpus/module-declaration5.diffA-B.txt | 24 +- .../corpus/module-declaration5.diffB-A.txt | 24 +- .../corpus/module-declaration5.parseA.txt | 14 +- .../corpus/module-declaration5.parseB.txt | 14 +- .../corpus/newtype-declaration.diffA-B.txt | 104 ++-- .../corpus/newtype-declaration.diffB-A.txt | 104 ++-- .../corpus/newtype-declaration.parseA.txt | 78 ++- .../corpus/newtype-declaration.parseB.txt | 78 ++- .../corpus/type-signatures.diffA-B.txt | 443 +++++++++++++++-- .../corpus/type-signatures.diffB-A.txt | 441 +++++++++++++++-- .../haskell/corpus/type-signatures.parseA.txt | 240 +++++++++- .../haskell/corpus/type-signatures.parseB.txt | 217 ++++++++- .../haskell/corpus/type-synonyms.diffA-B.txt | 264 ++++++----- .../haskell/corpus/type-synonyms.diffB-A.txt | 242 +++++----- .../haskell/corpus/type-synonyms.parseA.txt | 121 ++--- .../haskell/corpus/type-synonyms.parseB.txt | 125 ++--- 50 files changed, 3488 insertions(+), 2198 deletions(-) diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index a87f79ae6..4556b4f38 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -38,7 +38,9 @@ type Syntax = '[ , Syntax.AllConstructors , Syntax.AnnotatedTypeVariable , Syntax.Class + , Syntax.ConstructorIdentifier , Syntax.ConstructorOperator + , Syntax.ConstructorSymbol , Syntax.Context , Syntax.Context' , Syntax.DefaultDeclaration @@ -61,8 +63,10 @@ type Syntax = '[ , Syntax.ListConstructor , Syntax.Module , Syntax.ModuleExport + , Syntax.ModuleIdentifier , Syntax.NewType , Syntax.Pragma + , Syntax.PrimitiveConstructorIdentifier , Syntax.QualifiedModuleIdentifier , Syntax.QualifiedTypeConstructorIdentifier , Syntax.QuotedName @@ -73,12 +77,18 @@ type Syntax = '[ , Syntax.StrictTypeVariable , Syntax.TupleConstructor , Syntax.Type + , Syntax.TypeClassIdentifier , Syntax.TypeConstructorExport + , Syntax.TypeConstructorIdentifier + , Syntax.TypeOperator , Syntax.TypePattern , Syntax.TypeSignature , Syntax.TypeSynonym + , Syntax.TypeVariableIdentifier , Syntax.UnitConstructor + , Syntax.VariableIdentifier , Syntax.VariableOperator + , Syntax.VariableSymbol , Type.TypeParameters , [] ] @@ -120,13 +130,13 @@ constructor = (makeTerm <$> symbol DataConstructor <*> children (Declaration.Co <|> (makeTerm <$> symbol RecordDataConstructor <*> children (Syntax.RecordDataConstructor <$> constructorIdentifier <*> fields)) constructorIdentifier :: Assignment -constructorIdentifier = makeTerm <$> symbol ConstructorIdentifier <*> (Syntax.Identifier . Name.name <$> source) +constructorIdentifier = makeTerm <$> symbol ConstructorIdentifier <*> (Syntax.ConstructorIdentifier . Name.name <$> source) constructorOperator :: Assignment constructorOperator = makeTerm <$> symbol ConstructorOperator <*> children (Syntax.ConstructorOperator <$> expression) constructorSymbol :: Assignment -constructorSymbol = makeTerm <$> symbol ConstructorSymbol <*> (Syntax.Identifier . Name.name <$> source) +constructorSymbol = makeTerm <$> symbol ConstructorSymbol <*> (Syntax.ConstructorSymbol . Name.name <$> source) context' :: Assignment context' = makeTerm <$> symbol Context <*> children (Syntax.Context' <$> manyTerm expression) @@ -314,13 +324,13 @@ moduleExport :: Assignment moduleExport = makeTerm <$> symbol ModuleExport <*> children (Syntax.ModuleExport <$> expressions) moduleIdentifier :: Assignment -moduleIdentifier = makeTerm <$> symbol ModuleIdentifier <*> (Syntax.Identifier . Name.name <$> source) +moduleIdentifier = makeTerm <$> symbol ModuleIdentifier <*> (Syntax.ModuleIdentifier . Name.name <$> source) newConstructor :: Assignment newConstructor = makeTerm <$> symbol NewConstructor <*> children (Declaration.Constructor <$> manyTerm (context' <|> scopedTypeVariables) <*> typeConstructor <*> typeParameters) newType :: Assignment -newType = makeTerm <$> symbol NewtypeDeclaration <*> children (Syntax.NewType <$> (context' <|> emptyTerm) <*> typeLeft <*> newConstructor <*> (derivingClause <|> emptyTerm)) +newType = makeTerm <$> symbol NewtypeDeclaration <*> children (Syntax.NewType <$> manyTerm (context' <|> scopedTypeVariables) <*> typeLeft <*> newConstructor <*> (derivingClause <|> emptyTerm)) where typeLeft = makeTerm <$> location <*> manyTermsTill expression (symbol NewConstructor) @@ -334,7 +344,7 @@ pragma :: Assignment pragma = makeTerm <$> symbol Pragma <*> (Syntax.Pragma <$> source) primitiveConstructorIdentifier :: Assignment -primitiveConstructorIdentifier = makeTerm <$> symbol PrimitiveConstructorIdentifier <*> (Syntax.Identifier . Name.name <$> source) +primitiveConstructorIdentifier = makeTerm <$> symbol PrimitiveConstructorIdentifier <*> (Syntax.PrimitiveConstructorIdentifier . Name.name <$> source) qualifiedModuleIdentifier :: Assignment qualifiedModuleIdentifier = makeTerm <$> symbol QualifiedModuleIdentifier <*> children (Syntax.QualifiedModuleIdentifier <$> someTerm' expression) @@ -364,22 +374,22 @@ tupleType :: Assignment tupleType = makeTerm <$> symbol TupleType <*> children (Literal.Tuple <$> manyTerm type') typeClassIdentifier :: Assignment -typeClassIdentifier = makeTerm <$> symbol TypeClassIdentifier <*> (Syntax.Identifier . Name.name <$> source) +typeClassIdentifier = makeTerm <$> symbol TypeClassIdentifier <*> (Syntax.TypeClassIdentifier . Name.name <$> source) typeConstructorExport :: Assignment typeConstructorExport = makeTerm <$> symbol TypeConstructorExport <*> children (Syntax.TypeConstructorExport <$> expression) typeConstructorIdentifier :: Assignment -typeConstructorIdentifier = makeTerm <$> symbol TypeConstructorIdentifier <*> (Syntax.Identifier . Name.name <$> source) +typeConstructorIdentifier = makeTerm <$> symbol TypeConstructorIdentifier <*> (Syntax.TypeConstructorIdentifier . Name.name <$> source) typeOperator :: Assignment -typeOperator = makeTerm <$> symbol TypeOperator <*> (Syntax.Identifier . Name.name <$> source) +typeOperator = makeTerm <$> symbol TypeOperator <*> (Syntax.TypeOperator . Name.name <$> source) typeSignature :: Assignment -typeSignature = makeTerm <$> symbol TypeSignature <*> children (Syntax.TypeSignature <$> variableIdentifier <* token Annotation <*> (manyTerm context' <|> pure []) <*> type') +typeSignature = makeTerm <$> symbol TypeSignature <*> children (Syntax.TypeSignature <$> variableIdentifier <* token Annotation <*> (manyTerm (context' <|> scopedTypeVariables)) <*> expression) typeVariableIdentifier :: Assignment -typeVariableIdentifier = makeTerm <$> symbol TypeVariableIdentifier <*> (Syntax.Identifier . Name.name <$> source) +typeVariableIdentifier = makeTerm <$> symbol TypeVariableIdentifier <*> (Syntax.TypeVariableIdentifier . Name.name <$> source) tuplingConstructor :: Assignment tuplingConstructor = makeTerm <$> symbol TuplingConstructor <*> (tupleWithArity <$> rawSource) @@ -434,13 +444,13 @@ unitConstructor :: Assignment unitConstructor = makeTerm <$> token UnitConstructor <*> pure Syntax.UnitConstructor variableIdentifier :: Assignment -variableIdentifier = makeTerm <$> symbol VariableIdentifier <*> (Syntax.Identifier . Name.name <$> source) +variableIdentifier = makeTerm <$> symbol VariableIdentifier <*> (Syntax.VariableIdentifier . Name.name <$> source) variableOperator :: Assignment variableOperator = makeTerm <$> symbol VariableOperator <*> children (Syntax.VariableOperator <$> expression) variableSymbol :: Assignment -variableSymbol = makeTerm <$> (symbol VariableSymbol <|> symbol VariableSymbol') <*> (Syntax.Identifier . Name.name <$> source) +variableSymbol = makeTerm <$> (symbol VariableSymbol <|> symbol VariableSymbol') <*> (Syntax.VariableSymbol . Name.name <$> source) variableIdentifiers :: Assignment variableIdentifiers = makeTerm <$> location <*> many variableIdentifier diff --git a/src/Language/Haskell/Syntax.hs b/src/Language/Haskell/Syntax.hs index 398ffd07c..8d20d6942 100644 --- a/src/Language/Haskell/Syntax.hs +++ b/src/Language/Haskell/Syntax.hs @@ -344,7 +344,7 @@ instance Show1 ScopedTypeVariables where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ScopedTypeVariables -data NewType a = NewType { newTypeContext :: a, newTypeLeft :: a, newTypeRight :: a, newTypeDeriving :: a } +data NewType a = NewType { newTypeContext :: [a], newTypeLeft :: a, newTypeRight :: a, newTypeDeriving :: a } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) instance Eq1 NewType where liftEq = genericLiftEq @@ -371,3 +371,92 @@ instance Show1 EqualityConstraint where liftShowsPrec = genericLiftShowsPrec instance Evaluatable EqualityConstraint +newtype TypeVariableIdentifier a = TypeVariableIdentifier { typeVariableIdentifiername :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 TypeVariableIdentifier where liftEq = genericLiftEq +instance Ord1 TypeVariableIdentifier where liftCompare = genericLiftCompare +instance Show1 TypeVariableIdentifier where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable TypeVariableIdentifier + +newtype TypeConstructorIdentifier a = TypeConstructorIdentifier { typeConstructorIdentifiername :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 TypeConstructorIdentifier where liftEq = genericLiftEq +instance Ord1 TypeConstructorIdentifier where liftCompare = genericLiftCompare +instance Show1 TypeConstructorIdentifier where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable TypeConstructorIdentifier + +newtype ModuleIdentifier a = ModuleIdentifier { moduleIdentifierName :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 ModuleIdentifier where liftEq = genericLiftEq +instance Ord1 ModuleIdentifier where liftCompare = genericLiftCompare +instance Show1 ModuleIdentifier where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable ModuleIdentifier + +newtype ConstructorIdentifier a = ConstructorIdentifier { constructorIdentifierName :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 ConstructorIdentifier where liftEq = genericLiftEq +instance Ord1 ConstructorIdentifier where liftCompare = genericLiftCompare +instance Show1 ConstructorIdentifier where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable ConstructorIdentifier + +newtype TypeClassIdentifier a = TypeClassIdentifier { typeClassIdentifierName :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 TypeClassIdentifier where liftEq = genericLiftEq +instance Ord1 TypeClassIdentifier where liftCompare = genericLiftCompare +instance Show1 TypeClassIdentifier where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable TypeClassIdentifier + +newtype VariableIdentifier a = VariableIdentifier { variableIdentifierName :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 VariableIdentifier where liftEq = genericLiftEq +instance Ord1 VariableIdentifier where liftCompare = genericLiftCompare +instance Show1 VariableIdentifier where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable VariableIdentifier + +newtype PrimitiveConstructorIdentifier a = PrimitiveConstructorIdentifier { primitiveConstructorIdentifierName :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 PrimitiveConstructorIdentifier where liftEq = genericLiftEq +instance Ord1 PrimitiveConstructorIdentifier where liftCompare = genericLiftCompare +instance Show1 PrimitiveConstructorIdentifier where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable PrimitiveConstructorIdentifier + +newtype ConstructorSymbol a = ConstructorSymbol { constructorSymbolName :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 ConstructorSymbol where liftEq = genericLiftEq +instance Ord1 ConstructorSymbol where liftCompare = genericLiftCompare +instance Show1 ConstructorSymbol where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable ConstructorSymbol + +newtype TypeOperator a = TypeOperator { typeOperatorName :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 TypeOperator where liftEq = genericLiftEq +instance Ord1 TypeOperator where liftCompare = genericLiftCompare +instance Show1 TypeOperator where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable TypeOperator + +newtype VariableSymbol a = VariableSymbol { variableSymbolName :: Name } + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 VariableSymbol where liftEq = genericLiftEq +instance Ord1 VariableSymbol where liftCompare = genericLiftCompare +instance Show1 VariableSymbol where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable VariableSymbol diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt index 27342de0b..f9f5a0fab 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt @@ -4,446 +4,453 @@ (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (StrictTypeVariable - (Identifier)))) + (TypeVariableIdentifier)))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (StrictTypeVariable - (Identifier)) - (Identifier))) + (TypeVariableIdentifier)) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) {+(Constructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} + {+(TypeParameters)+})+} + (Constructor + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } + (TypeParameters)) + {+(Constructor + {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} {+(Constructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} {+(Constructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} {+(Constructor - {+(Identifier)+} - {+(TypeParameters)+})+} - {+(Constructor - {+(Identifier)+} - {+(TypeParameters)+})+} - {+(Constructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Identifier)-} - {-(TypeParameters)-})-} - {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (RecordDataConstructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (RecordDataConstructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (Statements (Field (Statements - (Identifier) - (Identifier)) + (VariableIdentifier) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (RecordDataConstructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (RecordDataConstructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (Statements (Field (Statements - (Identifier) - (Identifier)) + (VariableIdentifier) + (VariableIdentifier)) (Type (Context (Pragma) (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters))) (TypeParameters) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) {-(Datatype {-(Empty)-} {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-} {-(RecordDataConstructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(Statements {-(Field {-(Statements - {-(Identifier)-})-} + {-(VariableIdentifier)-})-} {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-})-})-})-} {-(RecordDataConstructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(Statements {-(Field {-(Statements - {-(Identifier)-})-} + {-(VariableIdentifier)-})-} {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-})-})-})-} {-(Empty)-})-} (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) {+(Datatype {+(Empty)+} {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+} {+(RecordDataConstructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} {+(Statements {+(Field {+(Statements - {+(Identifier)+})+} + {+(VariableIdentifier)+})+} {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+})+})+})+} {+(RecordDataConstructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} {+(Statements {+(Field {+(Statements - {+(Identifier)+})+} + {+(VariableIdentifier)+})+} {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+})+})+})+} {+(Empty)+})+} (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Deriving - (Identifier))) + (TypeClassIdentifier))) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Deriving - { (Identifier) - ->(Identifier) } - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier))) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier))) (Datatype (Context' - (Class - { (Identifier) - ->(Identifier) } - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier))) - (Empty)) - (Datatype - (Context' - (Class - { (Identifier) - ->(Identifier) } - (TypeParameters - (Identifier))) - (Class - (Identifier) - (TypeParameters - (Identifier))) - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier) - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier) - (Identifier))) - (Empty)) - (Datatype - (Context' - (Class - (Identifier) - (TypeParameters - (Statements - (Identifier) - (Identifier)))) - (Class - { (Identifier) - ->(Identifier) } - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier) - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier) - (Identifier))) - (Empty)) - (Datatype - (Empty) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Context' - (Identifier)) - { (Identifier) - ->(Identifier) } - (TypeParameters - (Identifier))) - (Empty)) - (Datatype - (Empty) - (Type - (Identifier) - (TypeParameters - { (Identifier) - ->(Identifier) }) - (Empty)) - (Constructor - (Context' + (Statements (Class - (Identifier) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } (TypeParameters - { (Identifier) - ->(Identifier) }))) - (Identifier) + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) (TypeParameters - { (Identifier) - ->(Identifier) })) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Context' + (Statements + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeParameters + (TypeVariableIdentifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))))) + (Statements + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeParameters + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (Context' + (Statements + (TypeConstructorIdentifier))) + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Empty) + (Type + (TypeConstructorIdentifier) + (TypeParameters + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) }) + (Empty)) + (Constructor + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })))) + (ConstructorIdentifier) + (TypeParameters + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) + (Empty)) + (Datatype + (Empty) + (Type + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (StrictTypeVariable - (Identifier)))) + (PrimitiveConstructorIdentifier)))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor (ScopedTypeVariables - { (Identifier) - ->(Identifier) }) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) }) (Context' - (Class - (Identifier) - (TypeParameters - { (Identifier) - ->(Identifier) }))) - (Identifier) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })))) + (ConstructorIdentifier) (TypeParameters (Statements - (Identifier) - { (Identifier) - ->(Identifier) }))) + (TypeConstructorIdentifier) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) }))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt index 4715e23cb..99276a2b6 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt @@ -4,444 +4,453 @@ (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (StrictTypeVariable - (Identifier)))) + (TypeVariableIdentifier)))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (StrictTypeVariable - (Identifier)) - (Identifier))) + (TypeVariableIdentifier)) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) {+(Constructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} + {+(TypeParameters)+})+} + {+(Constructor + {+(ConstructorIdentifier)+} + {+(TypeParameters)+})+} + {+(Constructor + {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters)) {+(Constructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} {+(Constructor - {+(Identifier)+} - {+(TypeParameters)+})+} - {+(Constructor - {+(Identifier)+} - {+(TypeParameters)+})+} - {+(Constructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} {-(Constructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (RecordDataConstructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (RecordDataConstructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (Statements (Field (Statements - (Identifier) - (Identifier)) + (VariableIdentifier) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (RecordDataConstructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (RecordDataConstructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (Statements (Field (Statements - (Identifier) - (Identifier)) + (VariableIdentifier) + (VariableIdentifier)) (Type (Context (Pragma) (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters))) (TypeParameters) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) {+(Datatype {+(Empty)+} {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+} {+(RecordDataConstructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} {+(Statements {+(Field {+(Statements - {+(Identifier)+})+} + {+(VariableIdentifier)+})+} {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+})+})+})+} {+(RecordDataConstructor - {+(Identifier)+} + {+(ConstructorIdentifier)+} {+(Statements {+(Field {+(Statements - {+(Identifier)+})+} + {+(VariableIdentifier)+})+} {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+})+})+})+} {+(Empty)+})+} (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) {-(Datatype {-(Empty)-} {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-} {-(RecordDataConstructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(Statements {-(Field {-(Statements - {-(Identifier)-})-} + {-(VariableIdentifier)-})-} {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-})-})-})-} {-(RecordDataConstructor - {-(Identifier)-} + {-(ConstructorIdentifier)-} {-(Statements {-(Field {-(Statements - {-(Identifier)-})-} + {-(VariableIdentifier)-})-} {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-})-})-})-} {-(Empty)-})-} (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Deriving - (Identifier))) + (TypeClassIdentifier))) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Deriving - { (Identifier) - ->(Identifier) } - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier))) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier))) (Datatype (Context' - (Class - { (Identifier) - ->(Identifier) } - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier))) - (Empty)) - (Datatype - (Context' - (Class - { (Identifier) - ->(Identifier) } - (TypeParameters - (Identifier))) - (Class - (Identifier) - (TypeParameters - (Identifier))) - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier) - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier) - (Identifier))) - (Empty)) - (Datatype - (Context' - (Class - (Identifier) - (TypeParameters - (Statements - (Identifier) - (Identifier)))) - (Class - { (Identifier) - ->(Identifier) } - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier) - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier) - (Identifier))) - (Empty)) - (Datatype - (Empty) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Context' - (Identifier)) - { (Identifier) - ->(Identifier) } - (TypeParameters - (Identifier))) - (Empty)) - (Datatype - (Empty) - (Type - (Identifier) - (TypeParameters - { (Identifier) - ->(Identifier) }) - (Empty)) - (Constructor - (Context' + (Statements (Class - (Identifier) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } (TypeParameters - { (Identifier) - ->(Identifier) }))) - (Identifier) + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) (TypeParameters - { (Identifier) - ->(Identifier) })) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Context' + (Statements + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeParameters + (TypeVariableIdentifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))))) + (Statements + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeParameters + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - { (Identifier) - ->(Identifier) } + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (Context' + (Statements + (TypeConstructorIdentifier))) + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Empty) + (Type + (TypeConstructorIdentifier) + (TypeParameters + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) }) + (Empty)) + (Constructor + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })))) + (ConstructorIdentifier) + (TypeParameters + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })) + (Empty)) + (Datatype + (Empty) + (Type + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (StrictTypeVariable - (Identifier)))) + (PrimitiveConstructorIdentifier)))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor (ScopedTypeVariables - { (Identifier) - ->(Identifier) }) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) }) (Context' - (Class - (Identifier) - (TypeParameters - { (Identifier) - ->(Identifier) }))) - (Identifier) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) })))) + (ConstructorIdentifier) (TypeParameters (Statements - (Identifier) - { (Identifier) - ->(Identifier) }))) + (TypeConstructorIdentifier) + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) }))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt index 0af9b78e0..a3022c6c1 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseA.txt @@ -4,372 +4,381 @@ (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (StrictTypeVariable - (Identifier)))) + (TypeVariableIdentifier)))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (StrictTypeVariable - (Identifier)) - (Identifier))) + (TypeVariableIdentifier)) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier) - (Identifier)) + (VariableIdentifier) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier) - (Identifier)) + (VariableIdentifier) + (VariableIdentifier)) (Type (Context (Pragma) (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters))) (TypeParameters) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Deriving - (Identifier))) + (TypeClassIdentifier))) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Deriving - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier))) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier))) (Datatype (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier))) - (Empty)) - (Datatype - (Context' - (Class - (Identifier) - (TypeParameters - (Identifier))) - (Class - (Identifier) - (TypeParameters - (Identifier))) - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier) - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier) - (Identifier))) - (Empty)) - (Datatype - (Context' - (Class - (Identifier) - (TypeParameters - (Statements - (Identifier) - (Identifier)))) - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier) - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier) - (Identifier))) - (Empty)) - (Datatype - (Empty) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Context' - (Identifier)) - (Identifier) - (TypeParameters - (Identifier))) - (Empty)) - (Datatype - (Empty) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Context' + (Statements (Class - (Identifier) + (TypeClassIdentifier) (TypeParameters - (Identifier)))) - (Identifier) + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (Context' + (Statements + (TypeConstructorIdentifier))) + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Empty) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Empty) + (Type + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (StrictTypeVariable - (Identifier)))) + (PrimitiveConstructorIdentifier)))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor (ScopedTypeVariables - (Identifier)) + (TypeVariableIdentifier)) (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Identifier) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (ConstructorIdentifier) (TypeParameters (Statements - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier)))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt index 0af9b78e0..a3022c6c1 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.parseB.txt @@ -4,372 +4,381 @@ (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (StrictTypeVariable - (Identifier)))) + (TypeVariableIdentifier)))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (StrictTypeVariable - (Identifier)) - (Identifier))) + (TypeVariableIdentifier)) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier) - (Identifier)) + (VariableIdentifier) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier) - (Identifier)) + (VariableIdentifier) + (VariableIdentifier)) (Type (Context (Pragma) (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters))) (TypeParameters) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (RecordDataConstructor - (Identifier) + (ConstructorIdentifier) (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Deriving - (Identifier))) + (TypeClassIdentifier))) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters)) (Deriving - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier))) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier))) (Datatype (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier))) - (Empty)) - (Datatype - (Context' - (Class - (Identifier) - (TypeParameters - (Identifier))) - (Class - (Identifier) - (TypeParameters - (Identifier))) - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier) - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier) - (Identifier))) - (Empty)) - (Datatype - (Context' - (Class - (Identifier) - (TypeParameters - (Statements - (Identifier) - (Identifier)))) - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Type - (Identifier) - (TypeParameters - (Identifier) - (Identifier)) - (Empty)) - (Constructor - (Identifier) - (TypeParameters - (Identifier) - (Identifier))) - (Empty)) - (Datatype - (Empty) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Context' - (Identifier)) - (Identifier) - (TypeParameters - (Identifier))) - (Empty)) - (Datatype - (Empty) - (Type - (Identifier) - (TypeParameters - (Identifier)) - (Empty)) - (Constructor - (Context' + (Statements (Class - (Identifier) + (TypeClassIdentifier) (TypeParameters - (Identifier)))) - (Identifier) + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (Context' + (Statements + (TypeConstructorIdentifier))) + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Empty) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (Constructor + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (ConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier))) + (Empty)) + (Datatype + (Empty) + (Type + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (StrictTypeVariable - (Identifier)))) + (PrimitiveConstructorIdentifier)))) (Empty)) (Datatype (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Constructor (ScopedTypeVariables - (Identifier)) + (TypeVariableIdentifier)) (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) - (Identifier) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) + (ConstructorIdentifier) (TypeParameters (Statements - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier)))) (Empty)))) diff --git a/test/fixtures/haskell/corpus/default-declaration.diffA-B.txt b/test/fixtures/haskell/corpus/default-declaration.diffA-B.txt index 8592a3917..c6c4fb3b7 100644 --- a/test/fixtures/haskell/corpus/default-declaration.diffA-B.txt +++ b/test/fixtures/haskell/corpus/default-declaration.diffA-B.txt @@ -1,9 +1,9 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements (DefaultDeclaration - {+(Identifier)+} - {+(Identifier)+}) + {+(TypeConstructorIdentifier)+} + {+(TypeConstructorIdentifier)+}) {-(DefaultDeclaration - {-(Identifier)-} - {-(Identifier)-})-})) + {-(TypeConstructorIdentifier)-} + {-(TypeConstructorIdentifier)-})-})) diff --git a/test/fixtures/haskell/corpus/default-declaration.diffB-A.txt b/test/fixtures/haskell/corpus/default-declaration.diffB-A.txt index a323aaec0..ec0d51854 100644 --- a/test/fixtures/haskell/corpus/default-declaration.diffB-A.txt +++ b/test/fixtures/haskell/corpus/default-declaration.diffB-A.txt @@ -1,9 +1,9 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements (DefaultDeclaration - {-(Identifier)-} - {-(Identifier)-}) + {-(TypeConstructorIdentifier)-} + {-(TypeConstructorIdentifier)-}) {+(DefaultDeclaration - {+(Identifier)+} - {+(Identifier)+})+})) + {+(TypeConstructorIdentifier)+} + {+(TypeConstructorIdentifier)+})+})) diff --git a/test/fixtures/haskell/corpus/default-declaration.parseA.txt b/test/fixtures/haskell/corpus/default-declaration.parseA.txt index 6b36312ea..acb1310e8 100644 --- a/test/fixtures/haskell/corpus/default-declaration.parseA.txt +++ b/test/fixtures/haskell/corpus/default-declaration.parseA.txt @@ -1,7 +1,7 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements (DefaultDeclaration) (DefaultDeclaration - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeConstructorIdentifier)))) diff --git a/test/fixtures/haskell/corpus/default-declaration.parseB.txt b/test/fixtures/haskell/corpus/default-declaration.parseB.txt index 92660eb69..d336569a9 100644 --- a/test/fixtures/haskell/corpus/default-declaration.parseB.txt +++ b/test/fixtures/haskell/corpus/default-declaration.parseB.txt @@ -1,6 +1,6 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements (DefaultDeclaration - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeConstructorIdentifier)))) diff --git a/test/fixtures/haskell/corpus/gadt-declarations.diffA-B.txt b/test/fixtures/haskell/corpus/gadt-declarations.diffA-B.txt index 56734d575..90945fe74 100644 --- a/test/fixtures/haskell/corpus/gadt-declarations.diffA-B.txt +++ b/test/fixtures/haskell/corpus/gadt-declarations.diffA-B.txt @@ -4,89 +4,89 @@ (GADT (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (Statements - (Identifier) - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier) - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))))) (GADT (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (Statements - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (FunctionType (Type (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)))) (TypeParameters) (Empty)) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))) (GADT (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (Statements - (Identifier)) + (TypeVariableIdentifier)) (KindSignature (KindFunctionType (Kind @@ -100,75 +100,75 @@ (GADT (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (Statements - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (FunctionType (Type (StrictType (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (TypeConstructorIdentifier)) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier))) + (ModuleIdentifier) + (TypeConstructorIdentifier))) (Empty)))) (GADTConstructor (Empty) - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (FunctionType (Type (StrictType (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (TypeConstructorIdentifier)) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier))) + (ModuleIdentifier) + (TypeConstructorIdentifier))) (Empty)))) (GADTConstructor (Empty) - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (FunctionType (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)))))) (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (KindListType (KindFunctionType (Kind @@ -176,32 +176,32 @@ (Kind (Star))))) (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (Star))) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (Context (Pragma) (FunctionType (Type (StrictType - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters)) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))))))) diff --git a/test/fixtures/haskell/corpus/gadt-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/gadt-declarations.diffB-A.txt index 52a33ff2e..3fe518619 100644 --- a/test/fixtures/haskell/corpus/gadt-declarations.diffB-A.txt +++ b/test/fixtures/haskell/corpus/gadt-declarations.diffB-A.txt @@ -4,89 +4,89 @@ (GADT (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (Statements - (Identifier) - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier) - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))))) (GADT (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (Statements - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (FunctionType (Type (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)))) (TypeParameters) (Empty)) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))) (GADT (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (Statements - (Identifier)) + (TypeVariableIdentifier)) (KindSignature (KindFunctionType (Kind @@ -100,75 +100,75 @@ (GADT (Empty) (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (Statements - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (FunctionType (Type (StrictType (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (TypeConstructorIdentifier)) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier))) + (ModuleIdentifier) + (TypeConstructorIdentifier))) (Empty)))) (GADTConstructor (Empty) - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (FunctionType (Type (StrictType (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (TypeConstructorIdentifier)) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier))) + (ModuleIdentifier) + (TypeConstructorIdentifier))) (Empty)))) (GADTConstructor (Empty) - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (FunctionType (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)))))) (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (KindListType (KindFunctionType (Kind @@ -176,32 +176,32 @@ (Kind (Star))))) (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (Star))) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (Context (Pragma) (FunctionType (Type (StrictType - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters)) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))))))) diff --git a/test/fixtures/haskell/corpus/gadt-declarations.parseA.txt b/test/fixtures/haskell/corpus/gadt-declarations.parseA.txt index 5d2750deb..7925fd3bd 100644 --- a/test/fixtures/haskell/corpus/gadt-declarations.parseA.txt +++ b/test/fixtures/haskell/corpus/gadt-declarations.parseA.txt @@ -4,83 +4,83 @@ (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier) - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))))) (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)))) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))) (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier)) + (TypeVariableIdentifier)) (KindSignature (KindFunctionType (Kind @@ -92,71 +92,71 @@ (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type (StrictType (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (TypeConstructorIdentifier)) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier))) + (ModuleIdentifier) + (TypeConstructorIdentifier))) (Empty)))) (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type (StrictType (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (TypeConstructorIdentifier)) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier))) + (ModuleIdentifier) + (TypeConstructorIdentifier))) (Empty)))) (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)))))) (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (KindListType (KindFunctionType (Kind @@ -164,31 +164,31 @@ (Kind (Star))))) (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (Star))) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (Context (Pragma) (FunctionType (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))))))) diff --git a/test/fixtures/haskell/corpus/gadt-declarations.parseB.txt b/test/fixtures/haskell/corpus/gadt-declarations.parseB.txt index a6513365b..d615bc3c8 100644 --- a/test/fixtures/haskell/corpus/gadt-declarations.parseB.txt +++ b/test/fixtures/haskell/corpus/gadt-declarations.parseB.txt @@ -4,83 +4,83 @@ (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier) - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))))) (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty))) (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)))) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))) (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier)) + (TypeVariableIdentifier)) (KindSignature (KindFunctionType (Kind @@ -93,71 +93,71 @@ (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type (StrictType (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (TypeConstructorIdentifier)) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier))) + (ModuleIdentifier) + (TypeConstructorIdentifier))) (Empty)))) (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type (StrictType (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (TypeConstructorIdentifier)) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (QualifiedTypeConstructorIdentifier - (Identifier) - (Identifier))) + (ModuleIdentifier) + (TypeConstructorIdentifier))) (Empty)))) (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (FunctionType (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)))))) (GADT (Empty) (Type - (Identifier) + (TypeConstructorIdentifier) (Statements (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (KindListType (KindFunctionType (Kind @@ -165,31 +165,31 @@ (Kind (Star))))) (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (Star))) (Empty)) (Statements (GADTConstructor (Empty) - (Identifier) + (TypeConstructorIdentifier) (Context (Pragma) (FunctionType (Type (StrictType - (Identifier) + (TypeConstructorIdentifier) (TypeParameters)) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier) - (Identifier)) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (Empty)))))))))) diff --git a/test/fixtures/haskell/corpus/literals.diffA-B.txt b/test/fixtures/haskell/corpus/literals.diffA-B.txt index e428f0440..316dd79d5 100644 --- a/test/fixtures/haskell/corpus/literals.diffA-B.txt +++ b/test/fixtures/haskell/corpus/literals.diffA-B.txt @@ -1,232 +1,233 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Integer))) {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} - {+(Statements - {+(Integer)+})+})+} - {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(ConstructorIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(ConstructorIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Array {+(TextElement)+} @@ -264,231 +265,227 @@ {+(TextElement)+} {+(TextElement)+})+})+})+} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} {-(Function - {-(Identifier)-} - {-(Statements - {-(Integer)-})-})-} - {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(ConstructorIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(ConstructorIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Array {-(TextElement)-} diff --git a/test/fixtures/haskell/corpus/literals.diffB-A.txt b/test/fixtures/haskell/corpus/literals.diffB-A.txt index e428f0440..9c3428b9d 100644 --- a/test/fixtures/haskell/corpus/literals.diffB-A.txt +++ b/test/fixtures/haskell/corpus/literals.diffB-A.txt @@ -1,232 +1,235 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + (Integer))) {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Integer)+})+})+} {+(Function - {+(Identifier)+} - {+(Statements - {+(Integer)+})+})+} - {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Float)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(VariableIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(ConstructorIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements - {+(Identifier)+})+})+} + {+(ConstructorIdentifier)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} + {+(Statements + {+(Character)+})+})+} + (Function + { (VariableIdentifier) + ->(VariableIdentifier) } + (Statements + {+(Character)+} + {-(Integer)-})) + {+(Function + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} {+(Function - {+(Identifier)+} - {+(Statements - {+(Character)+})+})+} - {+(Function - {+(Identifier)+} - {+(Statements - {+(Character)+})+})+} - {+(Function - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Statements {+(Array {+(TextElement)+} @@ -264,231 +267,223 @@ {+(TextElement)+} {+(TextElement)+})+})+})+} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} {-(Function - {-(Identifier)-} - {-(Statements - {-(Integer)-})-})-} - {-(Function - {-(Identifier)-} - {-(Statements - {-(Integer)-})-})-} - {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Float)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(VariableIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(ConstructorIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements - {-(Identifier)-})-})-} + {-(ConstructorIdentifier)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Character)-})-})-} {-(Function - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Statements {-(Array {-(TextElement)-} diff --git a/test/fixtures/haskell/corpus/literals.parseA.txt b/test/fixtures/haskell/corpus/literals.parseA.txt index 80c1a030e..acaa1cfa4 100644 --- a/test/fixtures/haskell/corpus/literals.parseA.txt +++ b/test/fixtures/haskell/corpus/literals.parseA.txt @@ -1,232 +1,232 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (ConstructorIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (ConstructorIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Array (TextElement) diff --git a/test/fixtures/haskell/corpus/literals.parseB.txt b/test/fixtures/haskell/corpus/literals.parseB.txt index 80c1a030e..acaa1cfa4 100644 --- a/test/fixtures/haskell/corpus/literals.parseB.txt +++ b/test/fixtures/haskell/corpus/literals.parseB.txt @@ -1,232 +1,232 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Integer))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements (Float))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (VariableIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (ConstructorIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements - (Identifier))) + (ConstructorIdentifier))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Character))) (Function - (Identifier) + (VariableIdentifier) (Statements (Array (TextElement) diff --git a/test/fixtures/haskell/corpus/module-declaration1.diffA-B.txt b/test/fixtures/haskell/corpus/module-declaration1.diffA-B.txt index 0c3811f05..88beabdf1 100644 --- a/test/fixtures/haskell/corpus/module-declaration1.diffA-B.txt +++ b/test/fixtures/haskell/corpus/module-declaration1.diffA-B.txt @@ -1,4 +1,4 @@ (Module -{ (Identifier) -->(Identifier) } +{ (ModuleIdentifier) +->(ModuleIdentifier) } (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration1.diffB-A.txt b/test/fixtures/haskell/corpus/module-declaration1.diffB-A.txt index 0c3811f05..88beabdf1 100644 --- a/test/fixtures/haskell/corpus/module-declaration1.diffB-A.txt +++ b/test/fixtures/haskell/corpus/module-declaration1.diffB-A.txt @@ -1,4 +1,4 @@ (Module -{ (Identifier) -->(Identifier) } +{ (ModuleIdentifier) +->(ModuleIdentifier) } (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration1.parseA.txt b/test/fixtures/haskell/corpus/module-declaration1.parseA.txt index e3964fea2..f8ca60edd 100644 --- a/test/fixtures/haskell/corpus/module-declaration1.parseA.txt +++ b/test/fixtures/haskell/corpus/module-declaration1.parseA.txt @@ -1,3 +1,3 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration1.parseB.txt b/test/fixtures/haskell/corpus/module-declaration1.parseB.txt index e3964fea2..f8ca60edd 100644 --- a/test/fixtures/haskell/corpus/module-declaration1.parseB.txt +++ b/test/fixtures/haskell/corpus/module-declaration1.parseB.txt @@ -1,3 +1,3 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration2.diffA-B.txt b/test/fixtures/haskell/corpus/module-declaration2.diffA-B.txt index 0c3811f05..88beabdf1 100644 --- a/test/fixtures/haskell/corpus/module-declaration2.diffA-B.txt +++ b/test/fixtures/haskell/corpus/module-declaration2.diffA-B.txt @@ -1,4 +1,4 @@ (Module -{ (Identifier) -->(Identifier) } +{ (ModuleIdentifier) +->(ModuleIdentifier) } (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration2.diffB-A.txt b/test/fixtures/haskell/corpus/module-declaration2.diffB-A.txt index 0c3811f05..88beabdf1 100644 --- a/test/fixtures/haskell/corpus/module-declaration2.diffB-A.txt +++ b/test/fixtures/haskell/corpus/module-declaration2.diffB-A.txt @@ -1,4 +1,4 @@ (Module -{ (Identifier) -->(Identifier) } +{ (ModuleIdentifier) +->(ModuleIdentifier) } (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration2.parseA.txt b/test/fixtures/haskell/corpus/module-declaration2.parseA.txt index e3964fea2..f8ca60edd 100644 --- a/test/fixtures/haskell/corpus/module-declaration2.parseA.txt +++ b/test/fixtures/haskell/corpus/module-declaration2.parseA.txt @@ -1,3 +1,3 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration2.parseB.txt b/test/fixtures/haskell/corpus/module-declaration2.parseB.txt index e3964fea2..f8ca60edd 100644 --- a/test/fixtures/haskell/corpus/module-declaration2.parseB.txt +++ b/test/fixtures/haskell/corpus/module-declaration2.parseB.txt @@ -1,3 +1,3 @@ (Module - (Identifier) + (ModuleIdentifier) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration3.diffA-B.txt b/test/fixtures/haskell/corpus/module-declaration3.diffA-B.txt index fca54cb79..0605c17e6 100644 --- a/test/fixtures/haskell/corpus/module-declaration3.diffA-B.txt +++ b/test/fixtures/haskell/corpus/module-declaration3.diffA-B.txt @@ -2,8 +2,8 @@ (Empty) (Statements (QualifiedModuleIdentifier - { (Identifier) - ->(Identifier) } - { (Identifier) - ->(Identifier) }) + { (ModuleIdentifier) + ->(ModuleIdentifier) } + { (ModuleIdentifier) + ->(ModuleIdentifier) }) (Statements))) diff --git a/test/fixtures/haskell/corpus/module-declaration3.diffB-A.txt b/test/fixtures/haskell/corpus/module-declaration3.diffB-A.txt index fca54cb79..0605c17e6 100644 --- a/test/fixtures/haskell/corpus/module-declaration3.diffB-A.txt +++ b/test/fixtures/haskell/corpus/module-declaration3.diffB-A.txt @@ -2,8 +2,8 @@ (Empty) (Statements (QualifiedModuleIdentifier - { (Identifier) - ->(Identifier) } - { (Identifier) - ->(Identifier) }) + { (ModuleIdentifier) + ->(ModuleIdentifier) } + { (ModuleIdentifier) + ->(ModuleIdentifier) }) (Statements))) diff --git a/test/fixtures/haskell/corpus/module-declaration3.parseA.txt b/test/fixtures/haskell/corpus/module-declaration3.parseA.txt index 723ca1047..670349dbd 100644 --- a/test/fixtures/haskell/corpus/module-declaration3.parseA.txt +++ b/test/fixtures/haskell/corpus/module-declaration3.parseA.txt @@ -2,6 +2,6 @@ (Empty) (Statements (QualifiedModuleIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (ModuleIdentifier)) (Statements))) diff --git a/test/fixtures/haskell/corpus/module-declaration3.parseB.txt b/test/fixtures/haskell/corpus/module-declaration3.parseB.txt index 723ca1047..670349dbd 100644 --- a/test/fixtures/haskell/corpus/module-declaration3.parseB.txt +++ b/test/fixtures/haskell/corpus/module-declaration3.parseB.txt @@ -2,6 +2,6 @@ (Empty) (Statements (QualifiedModuleIdentifier - (Identifier) - (Identifier)) + (ModuleIdentifier) + (ModuleIdentifier)) (Statements))) diff --git a/test/fixtures/haskell/corpus/module-declaration4.diffA-B.txt b/test/fixtures/haskell/corpus/module-declaration4.diffA-B.txt index 831c9c3f8..c4a9d6521 100644 --- a/test/fixtures/haskell/corpus/module-declaration4.diffA-B.txt +++ b/test/fixtures/haskell/corpus/module-declaration4.diffA-B.txt @@ -1,12 +1,12 @@ (Module - (Identifier) + (ModuleIdentifier) (Export (TypeConstructorExport (VariableOperator - { (Identifier) - ->(Identifier) }))) + { (VariableSymbol) + ->(VariableSymbol) }))) (Export (VariableOperator - { (Identifier) - ->(Identifier) })) + { (VariableSymbol) + ->(VariableSymbol) })) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration4.diffB-A.txt b/test/fixtures/haskell/corpus/module-declaration4.diffB-A.txt index 831c9c3f8..c4a9d6521 100644 --- a/test/fixtures/haskell/corpus/module-declaration4.diffB-A.txt +++ b/test/fixtures/haskell/corpus/module-declaration4.diffB-A.txt @@ -1,12 +1,12 @@ (Module - (Identifier) + (ModuleIdentifier) (Export (TypeConstructorExport (VariableOperator - { (Identifier) - ->(Identifier) }))) + { (VariableSymbol) + ->(VariableSymbol) }))) (Export (VariableOperator - { (Identifier) - ->(Identifier) })) + { (VariableSymbol) + ->(VariableSymbol) })) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration4.parseA.txt b/test/fixtures/haskell/corpus/module-declaration4.parseA.txt index 7f31126c8..23ce5b5a8 100644 --- a/test/fixtures/haskell/corpus/module-declaration4.parseA.txt +++ b/test/fixtures/haskell/corpus/module-declaration4.parseA.txt @@ -1,10 +1,10 @@ (Module - (Identifier) + (ModuleIdentifier) (Export (TypeConstructorExport (VariableOperator - (Identifier)))) + (VariableSymbol)))) (Export (VariableOperator - (Identifier))) + (VariableSymbol))) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration4.parseB.txt b/test/fixtures/haskell/corpus/module-declaration4.parseB.txt index 7f31126c8..23ce5b5a8 100644 --- a/test/fixtures/haskell/corpus/module-declaration4.parseB.txt +++ b/test/fixtures/haskell/corpus/module-declaration4.parseB.txt @@ -1,10 +1,10 @@ (Module - (Identifier) + (ModuleIdentifier) (Export (TypeConstructorExport (VariableOperator - (Identifier)))) + (VariableSymbol)))) (Export (VariableOperator - (Identifier))) + (VariableSymbol))) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration5.diffA-B.txt b/test/fixtures/haskell/corpus/module-declaration5.diffA-B.txt index 6bd003671..f4d77de97 100644 --- a/test/fixtures/haskell/corpus/module-declaration5.diffA-B.txt +++ b/test/fixtures/haskell/corpus/module-declaration5.diffA-B.txt @@ -1,28 +1,28 @@ (Module -{ (Identifier) -->(Identifier) } +{ (ModuleIdentifier) +->(ModuleIdentifier) } (Export (Statements - (Identifier) + (TypeConstructorIdentifier) (AllConstructors))) (Export (TypeConstructorExport (ConstructorOperator - { (Identifier) - ->(Identifier) }))) + { (ConstructorSymbol) + ->(ConstructorSymbol) }))) (Export (TypeConstructorExport (VariableOperator - { (Identifier) - ->(Identifier) }))) + { (VariableSymbol) + ->(VariableSymbol) }))) (Export - (Identifier)) + (VariableIdentifier)) (Export (ModuleExport - { (Identifier) - ->(Identifier) })) + { (ModuleIdentifier) + ->(ModuleIdentifier) })) (Export (TypeConstructorExport - { (Identifier) - ->(Identifier) })) + { (ConstructorIdentifier) + ->(ConstructorIdentifier) })) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration5.diffB-A.txt b/test/fixtures/haskell/corpus/module-declaration5.diffB-A.txt index 6bd003671..f4d77de97 100644 --- a/test/fixtures/haskell/corpus/module-declaration5.diffB-A.txt +++ b/test/fixtures/haskell/corpus/module-declaration5.diffB-A.txt @@ -1,28 +1,28 @@ (Module -{ (Identifier) -->(Identifier) } +{ (ModuleIdentifier) +->(ModuleIdentifier) } (Export (Statements - (Identifier) + (TypeConstructorIdentifier) (AllConstructors))) (Export (TypeConstructorExport (ConstructorOperator - { (Identifier) - ->(Identifier) }))) + { (ConstructorSymbol) + ->(ConstructorSymbol) }))) (Export (TypeConstructorExport (VariableOperator - { (Identifier) - ->(Identifier) }))) + { (VariableSymbol) + ->(VariableSymbol) }))) (Export - (Identifier)) + (VariableIdentifier)) (Export (ModuleExport - { (Identifier) - ->(Identifier) })) + { (ModuleIdentifier) + ->(ModuleIdentifier) })) (Export (TypeConstructorExport - { (Identifier) - ->(Identifier) })) + { (ConstructorIdentifier) + ->(ConstructorIdentifier) })) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration5.parseA.txt b/test/fixtures/haskell/corpus/module-declaration5.parseA.txt index aed76fcbd..e1a5754ae 100644 --- a/test/fixtures/haskell/corpus/module-declaration5.parseA.txt +++ b/test/fixtures/haskell/corpus/module-declaration5.parseA.txt @@ -1,23 +1,23 @@ (Module - (Identifier) + (ModuleIdentifier) (Export (Statements - (Identifier) + (TypeConstructorIdentifier) (AllConstructors))) (Export (TypeConstructorExport (ConstructorOperator - (Identifier)))) + (ConstructorSymbol)))) (Export (TypeConstructorExport (VariableOperator - (Identifier)))) + (VariableSymbol)))) (Export - (Identifier)) + (VariableIdentifier)) (Export (ModuleExport - (Identifier))) + (ModuleIdentifier))) (Export (TypeConstructorExport - (Identifier))) + (ConstructorIdentifier))) (Statements)) diff --git a/test/fixtures/haskell/corpus/module-declaration5.parseB.txt b/test/fixtures/haskell/corpus/module-declaration5.parseB.txt index aed76fcbd..e1a5754ae 100644 --- a/test/fixtures/haskell/corpus/module-declaration5.parseB.txt +++ b/test/fixtures/haskell/corpus/module-declaration5.parseB.txt @@ -1,23 +1,23 @@ (Module - (Identifier) + (ModuleIdentifier) (Export (Statements - (Identifier) + (TypeConstructorIdentifier) (AllConstructors))) (Export (TypeConstructorExport (ConstructorOperator - (Identifier)))) + (ConstructorSymbol)))) (Export (TypeConstructorExport (VariableOperator - (Identifier)))) + (VariableSymbol)))) (Export - (Identifier)) + (VariableIdentifier)) (Export (ModuleExport - (Identifier))) + (ModuleIdentifier))) (Export (TypeConstructorExport - (Identifier))) + (ConstructorIdentifier))) (Statements)) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt b/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt index c1b79348c..e6eb37bf6 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.diffA-B.txt @@ -2,101 +2,97 @@ (Empty) (Statements (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeConstructorIdentifier))) (Empty)) (NewType (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Empty)) (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (Statements (Field (Statements - { (Identifier) - ->(Identifier) }) + { (VariableIdentifier) + ->(VariableIdentifier) }) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)))))) (Empty)) (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) } - (Identifier) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (KindListType (KindFunctionType (Kind (Star)) (Kind (Star))))) - (Identifier)) + (TypeVariableIdentifier)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (Statements - (Identifier) - (Identifier) - (Identifier)))) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) (Empty)) (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeConstructorIdentifier))) (Deriving - (Identifier))) + (TypeClassIdentifier))) (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Deriving - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier))))) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier))))) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt b/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt index c1b79348c..e6eb37bf6 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.diffB-A.txt @@ -2,101 +2,97 @@ (Empty) (Statements (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeConstructorIdentifier))) (Empty)) (NewType (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Empty)) (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (Statements (Field (Statements - { (Identifier) - ->(Identifier) }) + { (VariableIdentifier) + ->(VariableIdentifier) }) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)))))) (Empty)) (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) } - (Identifier) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (KindListType (KindFunctionType (Kind (Star)) (Kind (Star))))) - (Identifier)) + (TypeVariableIdentifier)) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters (Statements - (Identifier) - (Identifier) - (Identifier)))) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) (Empty)) (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeConstructorIdentifier))) (Deriving - (Identifier))) + (TypeClassIdentifier))) (NewType - (Empty) (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (Constructor - { (Identifier) - ->(Identifier) } + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Deriving - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier))))) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier))))) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt b/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt index e25955c36..31b758185 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.parseA.txt @@ -2,88 +2,84 @@ (Empty) (Statements (NewType - (Empty) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeConstructorIdentifier))) (Empty)) (NewType (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Empty)) (NewType - (Empty) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)))))) (Empty)) (NewType - (Empty) (Statements - (Identifier) - (Identifier) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (KindListType (KindFunctionType (Kind (Star)) (Kind (Star))))) - (Identifier)) + (TypeVariableIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (Statements - (Identifier) - (Identifier) - (Identifier)))) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) (Empty)) (NewType - (Empty) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeConstructorIdentifier))) (Deriving - (Identifier))) + (TypeClassIdentifier))) (NewType - (Empty) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Deriving - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier))))) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier))))) diff --git a/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt b/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt index e25955c36..31b758185 100644 --- a/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt +++ b/test/fixtures/haskell/corpus/newtype-declaration.parseB.txt @@ -2,88 +2,84 @@ (Empty) (Statements (NewType - (Empty) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeConstructorIdentifier))) (Empty)) (NewType (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Empty)) (NewType - (Empty) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (Statements (Field (Statements - (Identifier)) + (VariableIdentifier)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)))))) (Empty)) (NewType - (Empty) (Statements - (Identifier) - (Identifier) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) (AnnotatedTypeVariable - (Identifier) + (TypeVariableIdentifier) (KindListType (KindFunctionType (Kind (Star)) (Kind (Star))))) - (Identifier)) + (TypeVariableIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters (Statements - (Identifier) - (Identifier) - (Identifier)))) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) (Empty)) (NewType - (Empty) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeConstructorIdentifier))) (Deriving - (Identifier))) + (TypeClassIdentifier))) (NewType - (Empty) (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Constructor - (Identifier) + (ConstructorIdentifier) (TypeParameters - (Identifier))) + (TypeVariableIdentifier))) (Deriving - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier) - (Identifier))))) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier) + (TypeClassIdentifier))))) diff --git a/test/fixtures/haskell/corpus/type-signatures.diffA-B.txt b/test/fixtures/haskell/corpus/type-signatures.diffA-B.txt index 038d7ba3e..5174da51a 100644 --- a/test/fixtures/haskell/corpus/type-signatures.diffA-B.txt +++ b/test/fixtures/haskell/corpus/type-signatures.diffA-B.txt @@ -2,98 +2,473 @@ (Empty) (Statements (TypeSignature - { (Identifier) - ->(Identifier) } + { (VariableIdentifier) + ->(VariableIdentifier) } (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty))))))) {+(TypeSignature - {+(Identifier)+} + {+(VariableIdentifier)+} {+(Context' - {+(Class - {+(Identifier)+} - {+(TypeParameters - {+(Identifier)+})+})+})+} + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+})+})+})+} {+(FunctionType {+(Type - {+(Identifier)+} + {+(TypeVariableIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+} {+(Type - {+(Identifier)+} + {+(TypeVariableIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(Tuple + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeConstructorIdentifier)+})+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(InfixOperatorPattern + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(TypeOperator)+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+})+} + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(InfixOperatorPattern + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(TypeOperator)+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+})+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(ScopedTypeVariables + {+(TypeVariableIdentifier)+})+} + {+(FunctionType + {+(Type + {+(Array + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(Array + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(ScopedTypeVariables + {+(Statements + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(Tuple + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(Array + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(Statements + {+(ScopedTypeVariables + {+(TypeVariableIdentifier)+})+} + {+(Context' + {+(Statements + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+})+} {-(TypeSignature - {-(Identifier)-} + {-(VariableIdentifier)-} {-(FunctionType {-(Type - {-(Identifier)-} + {-(TypeVariableIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-} {-(FunctionType {-(Type - {-(Identifier)-} + {-(TypeVariableIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-} {-(FunctionType {-(Type - {-(Identifier)-} + {-(TypeVariableIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-} {-(FunctionType {-(Type {-(Array {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-})-} {-(TypeParameters)-} {-(Empty)-})-} {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters - {-(Identifier)-})-} + {-(TypeConstructorIdentifier)-})-} {-(Empty)-})-})-})-})-})-})-} {-(TypeSignature - {-(Identifier)-} + {-(VariableIdentifier)-} {-(Context' - {-(Class - {-(Identifier)-} - {-(TypeParameters - {-(Identifier)-})-})-})-} + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-})-})-})-} {-(Context' - {-(Class - {-(Identifier)-} - {-(TypeParameters - {-(Identifier)-})-})-})-} + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-})-})-})-} {-(FunctionType {-(Type - {-(Identifier)-} + {-(TypeVariableIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-} {-(Type - {-(Identifier)-} + {-(TypeVariableIdentifier)-} {-(TypeParameters)-} - {-(Empty)-})-})-})-})) + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(Tuple + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeConstructorIdentifier)-})-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(InfixOperatorPattern + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(TypeOperator)-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-})-} + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(InfixOperatorPattern + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(TypeOperator)-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-})-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(ScopedTypeVariables + {-(TypeVariableIdentifier)-})-} + {-(FunctionType + {-(Type + {-(Array + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(Array + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(ScopedTypeVariables + {-(Statements + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(Tuple + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(Array + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(Statements + {-(ScopedTypeVariables + {-(TypeVariableIdentifier)-})-} + {-(Context' + {-(Statements + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-})-})) diff --git a/test/fixtures/haskell/corpus/type-signatures.diffB-A.txt b/test/fixtures/haskell/corpus/type-signatures.diffB-A.txt index ad2566e33..1d511880c 100644 --- a/test/fixtures/haskell/corpus/type-signatures.diffB-A.txt +++ b/test/fixtures/haskell/corpus/type-signatures.diffB-A.txt @@ -2,82 +2,465 @@ (Empty) (Statements (TypeSignature - { (Identifier) - ->(Identifier) } + { (VariableIdentifier) + ->(VariableIdentifier) } (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty))))))) {+(TypeSignature - {+(Identifier)+} + {+(VariableIdentifier)+} {+(FunctionType {+(Type - {+(Identifier)+} + {+(TypeVariableIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+} {+(FunctionType {+(Type - {+(Identifier)+} + {+(TypeVariableIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+} {+(FunctionType {+(Type - {+(Identifier)+} + {+(TypeVariableIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+} {+(FunctionType {+(Type {+(Array {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+})+} {+(TypeParameters)+} {+(Empty)+})+} {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters - {+(Identifier)+})+} + {+(TypeConstructorIdentifier)+})+} {+(Empty)+})+})+})+})+})+})+} - (TypeSignature - (Identifier) - (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) + {+(TypeSignature + {+(VariableIdentifier)+} {+(Context' - {+(Class - {+(Identifier)+} - {+(TypeParameters - {+(Identifier)+})+})+})+} + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+})+})+})+} + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+})+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + (TypeSignature + { (VariableIdentifier) + ->(VariableIdentifier) } + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-})-})-})-} (FunctionType (Type - (Identifier) + { (TypeVariableIdentifier) + ->(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+}) } (TypeParameters) (Empty)) (Type - (Identifier) + { (TypeVariableIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters) - (Empty)))))) + (Empty)))) + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(Tuple + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeConstructorIdentifier)+})+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(InfixOperatorPattern + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(TypeOperator)+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(Array + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+})+} + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(InfixOperatorPattern + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(TypeOperator)+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+})+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(ScopedTypeVariables + {+(TypeVariableIdentifier)+})+} + {+(FunctionType + {+(Type + {+(Array + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(Array + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(ScopedTypeVariables + {+(Statements + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(Tuple + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(Array + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(Statements + {+(ScopedTypeVariables + {+(TypeVariableIdentifier)+})+} + {+(Context' + {+(Statements + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+})+} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(Tuple + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeConstructorIdentifier)-})-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(InfixOperatorPattern + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(TypeOperator)-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(Array + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-})-} + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(InfixOperatorPattern + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(TypeOperator)-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-})-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(ScopedTypeVariables + {-(TypeVariableIdentifier)-})-} + {-(FunctionType + {-(Type + {-(Array + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(Array + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(ScopedTypeVariables + {-(Statements + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(Tuple + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(Array + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(Statements + {-(ScopedTypeVariables + {-(TypeVariableIdentifier)-})-} + {-(Context' + {-(Statements + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-})-})) diff --git a/test/fixtures/haskell/corpus/type-signatures.parseA.txt b/test/fixtures/haskell/corpus/type-signatures.parseA.txt index 667af18de..3dceadee9 100644 --- a/test/fixtures/haskell/corpus/type-signatures.parseA.txt +++ b/test/fixtures/haskell/corpus/type-signatures.parseA.txt @@ -2,81 +2,269 @@ (Empty) (Statements (TypeSignature - (Identifier) + (VariableIdentifier) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty))))))) (TypeSignature - (Identifier) + (VariableIdentifier) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type (Array (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty))) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty))))))) (TypeSignature - (Identifier) + (VariableIdentifier) (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) - (Empty)))))) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (Tuple + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeConstructorIdentifier)) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (Statements + (TypeConstructorIdentifier) + (InfixOperatorPattern + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (TypeOperator) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty))) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeConstructorIdentifier) + (InfixOperatorPattern + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (TypeOperator) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)))))) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (ScopedTypeVariables + (TypeVariableIdentifier)) + (FunctionType + (Type + (Array + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (Array + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (ScopedTypeVariables + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (FunctionType + (Type + (Tuple + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (Array + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (FunctionType + (Type + (Statements + (ScopedTypeVariables + (TypeVariableIdentifier)) + (Context' + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)))) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)))))))) diff --git a/test/fixtures/haskell/corpus/type-signatures.parseB.txt b/test/fixtures/haskell/corpus/type-signatures.parseB.txt index cdb45fcfc..107692d14 100644 --- a/test/fixtures/haskell/corpus/type-signatures.parseB.txt +++ b/test/fixtures/haskell/corpus/type-signatures.parseB.txt @@ -2,45 +2,232 @@ (Empty) (Statements (TypeSignature - (Identifier) + (VariableIdentifier) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (FunctionType (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty))))))) (TypeSignature - (Identifier) + (VariableIdentifier) (Context' - (Class - (Identifier) - (TypeParameters - (Identifier)))) + (Statements + (Class + (TypeClassIdentifier) + (TypeParameters + (TypeVariableIdentifier))))) (FunctionType (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeVariableIdentifier) (TypeParameters) - (Empty)))))) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (Tuple + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeConstructorIdentifier)) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (Statements + (TypeConstructorIdentifier) + (InfixOperatorPattern + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (TypeOperator) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters + (Array + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty))) + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeConstructorIdentifier) + (InfixOperatorPattern + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (TypeOperator) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)))))) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (ScopedTypeVariables + (TypeVariableIdentifier)) + (FunctionType + (Type + (Array + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (Array + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (ScopedTypeVariables + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (FunctionType + (Type + (Tuple + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)) + (Type + (Array + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (TypeParameters) + (Empty)))) + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (FunctionType + (Type + (Statements + (ScopedTypeVariables + (TypeVariableIdentifier)) + (Context' + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters + (TypeVariableIdentifier)) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)))) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeConstructorIdentifier) + (TypeParameters + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)))))))) diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt b/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt index 66ee7f4e8..11e9f58b4 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt @@ -3,99 +3,99 @@ (Statements (TypeSynonym (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (TypePattern - { (Identifier) - ->(Identifier) })) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) })) (TypeSynonym (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (TypePattern (ListConstructor))) (TypeSynonym (Statements - (Identifier) - (Identifier) - {+(Identifier)+}) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + {+(TypeVariableIdentifier)+}) (TypePattern (Statements - (Identifier) - (Identifier) - {+(Identifier)+}))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + {+(TypeVariableIdentifier)+}))) (TypeSynonym (Statements - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) (TypePattern (Array (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty))))) (TypeSynonym (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (TypePattern (UnitConstructor))) {-(TypeSynonym {-(Statements - {-(Identifier)-})-} + {-(TypeConstructorIdentifier)-})-} {-(TypePattern {-(TupleConstructor)-})-})-} (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) {+(TypeSynonym {+(Statements - {+(Identifier)+})+} + {+(TypeConstructorIdentifier)+})+} {+(TypePattern {+(TupleConstructor)+})+})+} (TypeSynonym (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (TypePattern (FunctionConstructor))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (InfixOperatorPattern (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters {+(Statements - {+(Identifier)+} - {+(Identifier)+})+}) + {+(TypeConstructorIdentifier)+} + {+(TypeConstructorIdentifier)+})+}) (Empty)) - (Identifier) + (TypeOperator) (Type (InfixOperatorPattern (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)) - (Identifier) + (TypeOperator) (Type (InfixOperatorPattern (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters {-(Statements - {-(Identifier)-} - {-(Identifier)-})-}) + {-(TypeConstructorIdentifier)-} + {-(TypeConstructorIdentifier)-})-}) (Empty)) - (Identifier) + (TypeOperator) (Type (QuotedName (ListConstructor)) @@ -107,84 +107,130 @@ (Empty))))) (TypeSynonym (Statements - { (Identifier) - ->(Identifier) } - (Identifier) - (Identifier) - (Identifier)) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (TypePattern (QuotedName (Array (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (Statements - (Identifier) - (Identifier))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) (Empty)))))) - (TypeSynonym - (Statements - {-(Identifier)-} - (Identifier) - {+(Identifier)+}) - (TextElement)) - (TypeSynonym - (Statements - { (Identifier) - ->(Identifier) } - (Statements - { (Identifier) - ->(Identifier) } - (Identifier) - (Identifier))) - (TypePattern - (Statements - (Identifier) - (Identifier) - (Identifier)))) - (TypeSynonym - (Statements - { (Identifier) - ->(Identifier) }) - (Context' - (Identifier)) - (TypePattern - (Statements - { (Identifier) - ->(Identifier) } - (ListConstructor)))) - (TypeSynonym - (Statements - { (Identifier) - ->(Identifier) } - (Identifier) - (Identifier)) - (ScopedTypeVariables - (Statements - (Identifier) - (Identifier))) - (TypePattern - (Statements - { (Identifier) - ->(Identifier) } - (Identifier) - (Identifier)))) - (TypeSynonym - (Statements - (Statements - { (Identifier) - ->(Identifier) } - (Identifier) - (Identifier))) - (TypePattern - (Statements - (Identifier) - (Statements - { (Identifier) - ->(Identifier) } - (Identifier) - (Identifier))))))) + {+(TypeSynonym + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeConstructorIdentifier)+})+} + {+(TextElement)+})+} + {+(TypeSynonym + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypePattern + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(TypeSynonym + {+(Statements + {+(TypeConstructorIdentifier)+})+} + {+(Context' + {+(Statements + {+(TypeConstructorIdentifier)+})+})+} + {+(TypePattern + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(ListConstructor)+})+})+})+} + {+(TypeSynonym + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(ScopedTypeVariables + {+(Statements + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypePattern + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(TypeSynonym + {+(Statements + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypePattern + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+})+} + {-(TypeSynonym + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(TypeConstructorIdentifier)-})-} + {-(TextElement)-})-} + {-(TypeSynonym + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypePattern + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(TypeSynonym + {-(Statements + {-(TypeConstructorIdentifier)-})-} + {-(Context' + {-(Statements + {-(TypeConstructorIdentifier)-})-})-} + {-(TypePattern + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(ListConstructor)-})-})-})-} + {-(TypeSynonym + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(ScopedTypeVariables + {-(Statements + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypePattern + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(TypeSynonym + {-(Statements + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypePattern + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(Statements + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-})-})) diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt index 95d3b2b10..2861353eb 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt @@ -3,88 +3,88 @@ (Statements (TypeSynonym (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (TypePattern - { (Identifier) - ->(Identifier) })) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) })) (TypeSynonym (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (TypePattern (ListConstructor))) (TypeSynonym (Statements - (Identifier) - (Identifier) - {-(Identifier)-}) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + {-(TypeVariableIdentifier)-}) (TypePattern (Statements - (Identifier) - (Identifier) - {-(Identifier)-}))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + {-(TypeVariableIdentifier)-}))) (TypeSynonym (Statements - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) (TypePattern (Array (Type - { (Identifier) - ->(Identifier) } + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty))))) (TypeSynonym (Statements - { (Identifier) - ->(Identifier) }) + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) (TypePattern (UnitConstructor))) {+(TypeSynonym {+(Statements - {+(Identifier)+})+} + {+(TypeConstructorIdentifier)+})+} {+(TypePattern {+(TupleConstructor)+})+})+} (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) {+(TypeSynonym {+(Statements - {+(Identifier)+})+} + {+(TypeConstructorIdentifier)+})+} {+(TypePattern {+(FunctionConstructor)+})+})+} {+(TypeSynonym {+(Statements - {+(Identifier)+})+} + {+(TypeConstructorIdentifier)+})+} {+(TypePattern {+(InfixOperatorPattern {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+} - {+(Identifier)+} + {+(TypeOperator)+} {+(Type {+(InfixOperatorPattern {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters - {+(Identifier)+})+} + {+(TypeConstructorIdentifier)+})+} {+(Empty)+})+} - {+(Identifier)+} + {+(TypeOperator)+} {+(Type {+(InfixOperatorPattern {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters {+(Statements - {+(Identifier)+} - {+(Identifier)+})+})+} + {+(TypeConstructorIdentifier)+} + {+(TypeConstructorIdentifier)+})+})+} {+(Empty)+})+} - {+(Identifier)+} + {+(TypeOperator)+} {+(Type {+(QuotedName {+(ListConstructor)+})+} @@ -96,115 +96,114 @@ {+(Empty)+})+})+})+})+} {+(TypeSynonym {+(Statements - {+(Identifier)+} - {+(Identifier)+} - {+(Identifier)+} - {+(Identifier)+})+} + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+} {+(TypePattern {+(QuotedName {+(Array {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters)+} {+(Empty)+})+} {+(Type - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(TypeParameters {+(Statements - {+(Identifier)+} - {+(Identifier)+})+})+} + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} {+(Empty)+})+})+})+})+})+} + (TypeSynonym + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + {+(TypeConstructorIdentifier)+}) + { (TypePattern + {-(TupleConstructor)-}) + ->(TextElement) }) {+(TypeSynonym {+(Statements - {+(Identifier)+} - {+(Identifier)+})+} - {+(TextElement)+})+} - {+(TypeSynonym - {+(Statements - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(Statements - {+(Identifier)+} - {+(Identifier)+} - {+(Identifier)+})+})+} + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} {+(TypePattern {+(Statements - {+(Identifier)+} - {+(Identifier)+} - {+(Identifier)+})+})+})+} + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} {+(TypeSynonym {+(Statements - {+(Identifier)+})+} + {+(TypeConstructorIdentifier)+})+} {+(Context' - {+(Identifier)+})+} + {+(Statements + {+(TypeConstructorIdentifier)+})+})+} {+(TypePattern {+(Statements - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(ListConstructor)+})+})+})+} {+(TypeSynonym {+(Statements - {+(Identifier)+} - {+(Identifier)+} - {+(Identifier)+})+} + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+} {+(ScopedTypeVariables {+(Statements - {+(Identifier)+} - {+(Identifier)+})+})+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} {+(TypePattern {+(Statements - {+(Identifier)+} - {+(Identifier)+} - {+(Identifier)+})+})+})+} + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} {+(TypeSynonym {+(Statements {+(Statements - {+(Identifier)+} - {+(Identifier)+} - {+(Identifier)+})+})+} + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} {+(TypePattern {+(Statements - {+(Identifier)+} + {+(TypeConstructorIdentifier)+} {+(Statements - {+(Identifier)+} - {+(Identifier)+} - {+(Identifier)+})+})+})+})+} + {+(TypeConstructorIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+})+} {-(TypeSynonym {-(Statements - {-(Identifier)-})-} - {-(TypePattern - {-(TupleConstructor)-})-})-} - {-(TypeSynonym - {-(Statements - {-(Identifier)-})-} + {-(TypeConstructorIdentifier)-})-} {-(TypePattern {-(FunctionConstructor)-})-})-} {-(TypeSynonym {-(Statements - {-(Identifier)-})-} + {-(TypeConstructorIdentifier)-})-} {-(TypePattern {-(InfixOperatorPattern {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters {-(Statements - {-(Identifier)-} - {-(Identifier)-})-})-} + {-(TypeConstructorIdentifier)-} + {-(TypeConstructorIdentifier)-})-})-} {-(Empty)-})-} - {-(Identifier)-} + {-(TypeOperator)-} {-(Type {-(InfixOperatorPattern {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters - {-(Identifier)-})-} + {-(TypeConstructorIdentifier)-})-} {-(Empty)-})-} - {-(Identifier)-} + {-(TypeOperator)-} {-(Type {-(InfixOperatorPattern {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-} - {-(Identifier)-} + {-(TypeOperator)-} {-(Type {-(QuotedName {-(ListConstructor)-})-} @@ -216,74 +215,75 @@ {-(Empty)-})-})-})-})-} {-(TypeSynonym {-(Statements - {-(Identifier)-} - {-(Identifier)-} - {-(Identifier)-} - {-(Identifier)-})-} + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-} {-(TypePattern {-(QuotedName {-(Array {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters)-} {-(Empty)-})-} {-(Type - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(TypeParameters {-(Statements - {-(Identifier)-} - {-(Identifier)-})-})-} + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} {-(Empty)-})-})-})-})-})-} {-(TypeSynonym {-(Statements - {-(Identifier)-} - {-(Identifier)-})-} + {-(TypeConstructorIdentifier)-} + {-(TypeConstructorIdentifier)-})-} {-(TextElement)-})-} {-(TypeSynonym {-(Statements - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(Statements - {-(Identifier)-} - {-(Identifier)-} - {-(Identifier)-})-})-} + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} {-(TypePattern {-(Statements - {-(Identifier)-} - {-(Identifier)-} - {-(Identifier)-})-})-})-} + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} {-(TypeSynonym {-(Statements - {-(Identifier)-})-} + {-(TypeConstructorIdentifier)-})-} {-(Context' - {-(Identifier)-})-} + {-(Statements + {-(TypeConstructorIdentifier)-})-})-} {-(TypePattern {-(Statements - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(ListConstructor)-})-})-})-} {-(TypeSynonym {-(Statements - {-(Identifier)-} - {-(Identifier)-} - {-(Identifier)-})-} + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-} {-(ScopedTypeVariables {-(Statements - {-(Identifier)-} - {-(Identifier)-})-})-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} {-(TypePattern {-(Statements - {-(Identifier)-} - {-(Identifier)-} - {-(Identifier)-})-})-})-} + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} {-(TypeSynonym {-(Statements {-(Statements - {-(Identifier)-} - {-(Identifier)-} - {-(Identifier)-})-})-} + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} {-(TypePattern {-(Statements - {-(Identifier)-} + {-(TypeConstructorIdentifier)-} {-(Statements - {-(Identifier)-} - {-(Identifier)-} - {-(Identifier)-})-})-})-})-})) + {-(TypeConstructorIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-})-})) diff --git a/test/fixtures/haskell/corpus/type-synonyms.parseA.txt b/test/fixtures/haskell/corpus/type-synonyms.parseA.txt index c857cfc54..02c4c5d07 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.parseA.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.parseA.txt @@ -3,81 +3,81 @@ (Statements (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern - (Identifier))) + (TypeConstructorIdentifier))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (ListConstructor))) (TypeSynonym (Statements - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) (TypePattern (Statements - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier)))) (TypeSynonym (Statements - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) (TypePattern (Array (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty))))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (UnitConstructor))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (FunctionConstructor))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (InfixOperatorPattern (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) - (Identifier) + (TypeOperator) (Type (InfixOperatorPattern (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)) - (Identifier) + (TypeOperator) (Type (InfixOperatorPattern (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (Statements - (Identifier) - (Identifier))) + (TypeConstructorIdentifier) + (TypeConstructorIdentifier))) (Empty)) - (Identifier) + (TypeOperator) (Type (QuotedName (ListConstructor)) @@ -89,74 +89,75 @@ (Empty))))) (TypeSynonym (Statements - (Identifier) - (Identifier) - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (TypePattern (QuotedName (Array (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (Statements - (Identifier) - (Identifier))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) (Empty)))))) (TypeSynonym (Statements - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeConstructorIdentifier)) (TextElement)) (TypeSynonym (Statements - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier) - (Identifier) - (Identifier))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (TypePattern (Statements - (Identifier) - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Context' - (Identifier)) + (Statements + (TypeConstructorIdentifier))) (TypePattern (Statements - (Identifier) + (TypeConstructorIdentifier) (ListConstructor)))) (TypeSynonym (Statements - (Identifier) - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (ScopedTypeVariables (Statements - (Identifier) - (Identifier))) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (TypePattern (Statements - (Identifier) - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) (TypeSynonym (Statements (Statements - (Identifier) - (Identifier) - (Identifier))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (TypePattern (Statements - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier) - (Identifier) - (Identifier))))))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))))))) diff --git a/test/fixtures/haskell/corpus/type-synonyms.parseB.txt b/test/fixtures/haskell/corpus/type-synonyms.parseB.txt index f20aaa8d2..1188f81e4 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.parseB.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.parseB.txt @@ -3,83 +3,83 @@ (Statements (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern - (Identifier))) + (TypeConstructorIdentifier))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (ListConstructor))) (TypeSynonym (Statements - (Identifier) - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (TypePattern (Statements - (Identifier) - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) (TypeSynonym (Statements - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) (TypePattern (Array (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeVariableIdentifier)) (Empty))))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (UnitConstructor))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (FunctionConstructor))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (TypePattern (InfixOperatorPattern (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (Statements - (Identifier) - (Identifier))) + (TypeConstructorIdentifier) + (TypeConstructorIdentifier))) (Empty)) - (Identifier) + (TypeOperator) (Type (InfixOperatorPattern (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters - (Identifier)) + (TypeConstructorIdentifier)) (Empty)) - (Identifier) + (TypeOperator) (Type (InfixOperatorPattern (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) - (Identifier) + (TypeOperator) (Type (QuotedName (ListConstructor)) @@ -91,74 +91,75 @@ (Empty))))) (TypeSynonym (Statements - (Identifier) - (Identifier) - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (TypePattern (QuotedName (Array (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters) (Empty)) (Type - (Identifier) + (TypeConstructorIdentifier) (TypeParameters (Statements - (Identifier) - (Identifier))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier))) (Empty)))))) (TypeSynonym (Statements - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeConstructorIdentifier)) (TextElement)) (TypeSynonym (Statements - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier) - (Identifier) - (Identifier))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (TypePattern (Statements - (Identifier) - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) (TypeSynonym (Statements - (Identifier)) + (TypeConstructorIdentifier)) (Context' - (Identifier)) + (Statements + (TypeConstructorIdentifier))) (TypePattern (Statements - (Identifier) + (TypeConstructorIdentifier) (ListConstructor)))) (TypeSynonym (Statements - (Identifier) - (Identifier) - (Identifier)) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)) (ScopedTypeVariables (Statements - (Identifier) - (Identifier))) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (TypePattern (Statements - (Identifier) - (Identifier) - (Identifier)))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) (TypeSynonym (Statements (Statements - (Identifier) - (Identifier) - (Identifier))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) (TypePattern (Statements - (Identifier) + (TypeConstructorIdentifier) (Statements - (Identifier) - (Identifier) - (Identifier))))))) + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))))))) From c688f580f781c05a3e5eb52581418467d25c7a07 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 12:10:54 -0700 Subject: [PATCH 09/12] Regenerate go test fixtures --- test/fixtures/go/corpus/channel-types.diffA-B.txt | 2 -- test/fixtures/go/corpus/channel-types.diffB-A.txt | 2 -- test/fixtures/go/corpus/channel-types.parseA.txt | 1 - test/fixtures/go/corpus/channel-types.parseB.txt | 1 - test/fixtures/go/corpus/struct-field-declarations.diffA-B.txt | 1 - test/fixtures/go/corpus/struct-field-declarations.diffB-A.txt | 1 - test/fixtures/go/corpus/struct-field-declarations.parseA.txt | 1 - test/fixtures/go/corpus/struct-field-declarations.parseB.txt | 1 - test/fixtures/go/corpus/struct-literals.diffA-B.txt | 1 - test/fixtures/go/corpus/struct-literals.diffB-A.txt | 1 - test/fixtures/go/corpus/struct-literals.parseA.txt | 1 - test/fixtures/go/corpus/struct-literals.parseB.txt | 1 - test/fixtures/go/corpus/struct-types.diffA-B.txt | 4 ---- test/fixtures/go/corpus/struct-types.diffB-A.txt | 4 ---- test/fixtures/go/corpus/struct-types.parseA.txt | 4 ---- test/fixtures/go/corpus/struct-types.parseB.txt | 4 ---- test/fixtures/go/corpus/type-declarations.diffA-B.txt | 1 - test/fixtures/go/corpus/type-declarations.diffB-A.txt | 1 - test/fixtures/go/corpus/type-declarations.parseA.txt | 1 - test/fixtures/go/corpus/type-declarations.parseB.txt | 1 - 20 files changed, 34 deletions(-) diff --git a/test/fixtures/go/corpus/channel-types.diffA-B.txt b/test/fixtures/go/corpus/channel-types.diffA-B.txt index 0bb4c5d10..efabef389 100644 --- a/test/fixtures/go/corpus/channel-types.diffA-B.txt +++ b/test/fixtures/go/corpus/channel-types.diffA-B.txt @@ -16,7 +16,6 @@ {+(SendChannel {+(SendChannel {+(Constructor - {+(Empty)+} {+(Empty)+} {+(Statements)+})+})+})+})+} {+(Type @@ -45,7 +44,6 @@ {-(SendChannel {-(SendChannel {-(Constructor - {-(Empty)-} {-(Empty)-} {-(Statements)-})-})-})-})-} {-(Type diff --git a/test/fixtures/go/corpus/channel-types.diffB-A.txt b/test/fixtures/go/corpus/channel-types.diffB-A.txt index 0bb4c5d10..efabef389 100644 --- a/test/fixtures/go/corpus/channel-types.diffB-A.txt +++ b/test/fixtures/go/corpus/channel-types.diffB-A.txt @@ -16,7 +16,6 @@ {+(SendChannel {+(SendChannel {+(Constructor - {+(Empty)+} {+(Empty)+} {+(Statements)+})+})+})+})+} {+(Type @@ -45,7 +44,6 @@ {-(SendChannel {-(SendChannel {-(Constructor - {-(Empty)-} {-(Empty)-} {-(Statements)-})-})-})-})-} {-(Type diff --git a/test/fixtures/go/corpus/channel-types.parseA.txt b/test/fixtures/go/corpus/channel-types.parseA.txt index 4e94d7b52..1fac3aefe 100644 --- a/test/fixtures/go/corpus/channel-types.parseA.txt +++ b/test/fixtures/go/corpus/channel-types.parseA.txt @@ -16,7 +16,6 @@ (SendChannel (SendChannel (Constructor - (Empty) (Empty) (Statements))))) (Type diff --git a/test/fixtures/go/corpus/channel-types.parseB.txt b/test/fixtures/go/corpus/channel-types.parseB.txt index 4e94d7b52..1fac3aefe 100644 --- a/test/fixtures/go/corpus/channel-types.parseB.txt +++ b/test/fixtures/go/corpus/channel-types.parseB.txt @@ -16,7 +16,6 @@ (SendChannel (SendChannel (Constructor - (Empty) (Empty) (Statements))))) (Type diff --git a/test/fixtures/go/corpus/struct-field-declarations.diffA-B.txt b/test/fixtures/go/corpus/struct-field-declarations.diffA-B.txt index 51770074a..1d0b7c811 100644 --- a/test/fixtures/go/corpus/struct-field-declarations.diffA-B.txt +++ b/test/fixtures/go/corpus/struct-field-declarations.diffA-B.txt @@ -9,7 +9,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Field (Identifier) diff --git a/test/fixtures/go/corpus/struct-field-declarations.diffB-A.txt b/test/fixtures/go/corpus/struct-field-declarations.diffB-A.txt index dcd89776f..b7a5a2f01 100644 --- a/test/fixtures/go/corpus/struct-field-declarations.diffB-A.txt +++ b/test/fixtures/go/corpus/struct-field-declarations.diffB-A.txt @@ -9,7 +9,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Field (Identifier) diff --git a/test/fixtures/go/corpus/struct-field-declarations.parseA.txt b/test/fixtures/go/corpus/struct-field-declarations.parseA.txt index 53b7f27ab..a177758b5 100644 --- a/test/fixtures/go/corpus/struct-field-declarations.parseA.txt +++ b/test/fixtures/go/corpus/struct-field-declarations.parseA.txt @@ -9,7 +9,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Field (Identifier) diff --git a/test/fixtures/go/corpus/struct-field-declarations.parseB.txt b/test/fixtures/go/corpus/struct-field-declarations.parseB.txt index 3bbf256f0..a35c7eba2 100644 --- a/test/fixtures/go/corpus/struct-field-declarations.parseB.txt +++ b/test/fixtures/go/corpus/struct-field-declarations.parseB.txt @@ -9,7 +9,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Field (Identifier) diff --git a/test/fixtures/go/corpus/struct-literals.diffA-B.txt b/test/fixtures/go/corpus/struct-literals.diffA-B.txt index 1f004f5d8..23a19ce10 100644 --- a/test/fixtures/go/corpus/struct-literals.diffA-B.txt +++ b/test/fixtures/go/corpus/struct-literals.diffA-B.txt @@ -22,7 +22,6 @@ (Identifier) (Composite (Constructor - (Empty) (Empty) (Field { (Identifier) diff --git a/test/fixtures/go/corpus/struct-literals.diffB-A.txt b/test/fixtures/go/corpus/struct-literals.diffB-A.txt index 1f004f5d8..23a19ce10 100644 --- a/test/fixtures/go/corpus/struct-literals.diffB-A.txt +++ b/test/fixtures/go/corpus/struct-literals.diffB-A.txt @@ -22,7 +22,6 @@ (Identifier) (Composite (Constructor - (Empty) (Empty) (Field { (Identifier) diff --git a/test/fixtures/go/corpus/struct-literals.parseA.txt b/test/fixtures/go/corpus/struct-literals.parseA.txt index c1b30448b..0c3b896d3 100644 --- a/test/fixtures/go/corpus/struct-literals.parseA.txt +++ b/test/fixtures/go/corpus/struct-literals.parseA.txt @@ -21,7 +21,6 @@ (Identifier) (Composite (Constructor - (Empty) (Empty) (Field (Identifier) diff --git a/test/fixtures/go/corpus/struct-literals.parseB.txt b/test/fixtures/go/corpus/struct-literals.parseB.txt index c1b30448b..0c3b896d3 100644 --- a/test/fixtures/go/corpus/struct-literals.parseB.txt +++ b/test/fixtures/go/corpus/struct-literals.parseB.txt @@ -21,7 +21,6 @@ (Identifier) (Composite (Constructor - (Empty) (Empty) (Field (Identifier) diff --git a/test/fixtures/go/corpus/struct-types.diffA-B.txt b/test/fixtures/go/corpus/struct-types.diffA-B.txt index 3c447e013..bbcd1812c 100644 --- a/test/fixtures/go/corpus/struct-types.diffA-B.txt +++ b/test/fixtures/go/corpus/struct-types.diffA-B.txt @@ -11,7 +11,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Statements)))) (Statements @@ -19,7 +18,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Field (Identifier) @@ -29,7 +27,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Field (Identifier) @@ -41,7 +38,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Statements (Field diff --git a/test/fixtures/go/corpus/struct-types.diffB-A.txt b/test/fixtures/go/corpus/struct-types.diffB-A.txt index 3c447e013..bbcd1812c 100644 --- a/test/fixtures/go/corpus/struct-types.diffB-A.txt +++ b/test/fixtures/go/corpus/struct-types.diffB-A.txt @@ -11,7 +11,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Statements)))) (Statements @@ -19,7 +18,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Field (Identifier) @@ -29,7 +27,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Field (Identifier) @@ -41,7 +38,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Statements (Field diff --git a/test/fixtures/go/corpus/struct-types.parseA.txt b/test/fixtures/go/corpus/struct-types.parseA.txt index 93f78b565..56fb82daf 100644 --- a/test/fixtures/go/corpus/struct-types.parseA.txt +++ b/test/fixtures/go/corpus/struct-types.parseA.txt @@ -10,14 +10,12 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Statements)))) (Statements (Type (Identifier) (Constructor - (Empty) (Empty) (Field (Identifier) @@ -26,7 +24,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Field (Identifier) @@ -37,7 +34,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Statements (Field diff --git a/test/fixtures/go/corpus/struct-types.parseB.txt b/test/fixtures/go/corpus/struct-types.parseB.txt index 93f78b565..56fb82daf 100644 --- a/test/fixtures/go/corpus/struct-types.parseB.txt +++ b/test/fixtures/go/corpus/struct-types.parseB.txt @@ -10,14 +10,12 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Statements)))) (Statements (Type (Identifier) (Constructor - (Empty) (Empty) (Field (Identifier) @@ -26,7 +24,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Field (Identifier) @@ -37,7 +34,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Statements (Field diff --git a/test/fixtures/go/corpus/type-declarations.diffA-B.txt b/test/fixtures/go/corpus/type-declarations.diffA-B.txt index 22748e379..07b5f067b 100644 --- a/test/fixtures/go/corpus/type-declarations.diffA-B.txt +++ b/test/fixtures/go/corpus/type-declarations.diffA-B.txt @@ -30,7 +30,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Statements (Field diff --git a/test/fixtures/go/corpus/type-declarations.diffB-A.txt b/test/fixtures/go/corpus/type-declarations.diffB-A.txt index 22748e379..07b5f067b 100644 --- a/test/fixtures/go/corpus/type-declarations.diffB-A.txt +++ b/test/fixtures/go/corpus/type-declarations.diffB-A.txt @@ -30,7 +30,6 @@ { (Identifier) ->(Identifier) } (Constructor - (Empty) (Empty) (Statements (Field diff --git a/test/fixtures/go/corpus/type-declarations.parseA.txt b/test/fixtures/go/corpus/type-declarations.parseA.txt index 61f1b0b35..0833c568a 100644 --- a/test/fixtures/go/corpus/type-declarations.parseA.txt +++ b/test/fixtures/go/corpus/type-declarations.parseA.txt @@ -23,7 +23,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Statements (Field diff --git a/test/fixtures/go/corpus/type-declarations.parseB.txt b/test/fixtures/go/corpus/type-declarations.parseB.txt index 61f1b0b35..0833c568a 100644 --- a/test/fixtures/go/corpus/type-declarations.parseB.txt +++ b/test/fixtures/go/corpus/type-declarations.parseB.txt @@ -23,7 +23,6 @@ (Type (Identifier) (Constructor - (Empty) (Empty) (Statements (Field From c1b0980383cd3cdb8851ecea0d1111ac2b6e1329 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 8 Jun 2018 12:13:58 -0700 Subject: [PATCH 10/12] I like hugging my code with extra `()`, sorry to inconvenience you hlint --- src/Language/Haskell/Assignment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index 4556b4f38..ddc53e133 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -386,7 +386,7 @@ typeOperator :: Assignment typeOperator = makeTerm <$> symbol TypeOperator <*> (Syntax.TypeOperator . Name.name <$> source) typeSignature :: Assignment -typeSignature = makeTerm <$> symbol TypeSignature <*> children (Syntax.TypeSignature <$> variableIdentifier <* token Annotation <*> (manyTerm (context' <|> scopedTypeVariables)) <*> expression) +typeSignature = makeTerm <$> symbol TypeSignature <*> children (Syntax.TypeSignature <$> variableIdentifier <* token Annotation <*> manyTerm (context' <|> scopedTypeVariables) <*> expression) typeVariableIdentifier :: Assignment typeVariableIdentifier = makeTerm <$> symbol TypeVariableIdentifier <*> (Syntax.TypeVariableIdentifier . Name.name <$> source) From 932f2d2267176b1ca9ca0809b77d5f4ab16e6a5c Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Mon, 11 Jun 2018 10:22:06 -0700 Subject: [PATCH 11/12] Use single type constructor for identifiers --- src/Language/Haskell/Assignment.hs | 8 +- src/Language/Haskell/Syntax.hs | 70 ++------ ...lgebraic-datatype-declarations.diffA-B.txt | 6 +- ...lgebraic-datatype-declarations.diffB-A.txt | 20 +-- .../haskell/corpus/literals.diffA-B.txt | 13 +- .../haskell/corpus/literals.diffB-A.txt | 69 +++---- .../haskell/corpus/type-synonyms.diffA-B.txt | 169 +++++++----------- .../haskell/corpus/type-synonyms.diffB-A.txt | 18 +- 8 files changed, 139 insertions(+), 234 deletions(-) diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index ddc53e133..abb2a844f 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -38,7 +38,6 @@ type Syntax = '[ , Syntax.AllConstructors , Syntax.AnnotatedTypeVariable , Syntax.Class - , Syntax.ConstructorIdentifier , Syntax.ConstructorOperator , Syntax.ConstructorSymbol , Syntax.Context @@ -46,6 +45,7 @@ type Syntax = '[ , Syntax.DefaultDeclaration , Syntax.Deriving , Syntax.Empty + , Syntax.EntityIdentifier , Syntax.Error , Syntax.EqualityConstraint , Syntax.Export @@ -63,10 +63,8 @@ type Syntax = '[ , Syntax.ListConstructor , Syntax.Module , Syntax.ModuleExport - , Syntax.ModuleIdentifier , Syntax.NewType , Syntax.Pragma - , Syntax.PrimitiveConstructorIdentifier , Syntax.QualifiedModuleIdentifier , Syntax.QualifiedTypeConstructorIdentifier , Syntax.QuotedName @@ -77,16 +75,12 @@ type Syntax = '[ , Syntax.StrictTypeVariable , Syntax.TupleConstructor , Syntax.Type - , Syntax.TypeClassIdentifier , Syntax.TypeConstructorExport - , Syntax.TypeConstructorIdentifier , Syntax.TypeOperator , Syntax.TypePattern , Syntax.TypeSignature , Syntax.TypeSynonym - , Syntax.TypeVariableIdentifier , Syntax.UnitConstructor - , Syntax.VariableIdentifier , Syntax.VariableOperator , Syntax.VariableSymbol , Type.TypeParameters diff --git a/src/Language/Haskell/Syntax.hs b/src/Language/Haskell/Syntax.hs index 8d20d6942..ae0b2c402 100644 --- a/src/Language/Haskell/Syntax.hs +++ b/src/Language/Haskell/Syntax.hs @@ -371,68 +371,20 @@ instance Show1 EqualityConstraint where liftShowsPrec = genericLiftShowsPrec instance Evaluatable EqualityConstraint -newtype TypeVariableIdentifier a = TypeVariableIdentifier { typeVariableIdentifiername :: Name } +data EntityIdentifier a = TypeVariableIdentifier Name + | TypeConstructorIdentifier Name + | ModuleIdentifier Name + | ConstructorIdentifier Name + | TypeClassIdentifier Name + | VariableIdentifier Name + | PrimitiveConstructorIdentifier Name deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) -instance Eq1 TypeVariableIdentifier where liftEq = genericLiftEq -instance Ord1 TypeVariableIdentifier where liftCompare = genericLiftCompare -instance Show1 TypeVariableIdentifier where liftShowsPrec = genericLiftShowsPrec +instance Eq1 EntityIdentifier where liftEq = genericLiftEq +instance Ord1 EntityIdentifier where liftCompare = genericLiftCompare +instance Show1 EntityIdentifier where liftShowsPrec = genericLiftShowsPrec -instance Evaluatable TypeVariableIdentifier - -newtype TypeConstructorIdentifier a = TypeConstructorIdentifier { typeConstructorIdentifiername :: Name } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 TypeConstructorIdentifier where liftEq = genericLiftEq -instance Ord1 TypeConstructorIdentifier where liftCompare = genericLiftCompare -instance Show1 TypeConstructorIdentifier where liftShowsPrec = genericLiftShowsPrec - -instance Evaluatable TypeConstructorIdentifier - -newtype ModuleIdentifier a = ModuleIdentifier { moduleIdentifierName :: Name } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 ModuleIdentifier where liftEq = genericLiftEq -instance Ord1 ModuleIdentifier where liftCompare = genericLiftCompare -instance Show1 ModuleIdentifier where liftShowsPrec = genericLiftShowsPrec - -instance Evaluatable ModuleIdentifier - -newtype ConstructorIdentifier a = ConstructorIdentifier { constructorIdentifierName :: Name } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 ConstructorIdentifier where liftEq = genericLiftEq -instance Ord1 ConstructorIdentifier where liftCompare = genericLiftCompare -instance Show1 ConstructorIdentifier where liftShowsPrec = genericLiftShowsPrec - -instance Evaluatable ConstructorIdentifier - -newtype TypeClassIdentifier a = TypeClassIdentifier { typeClassIdentifierName :: Name } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 TypeClassIdentifier where liftEq = genericLiftEq -instance Ord1 TypeClassIdentifier where liftCompare = genericLiftCompare -instance Show1 TypeClassIdentifier where liftShowsPrec = genericLiftShowsPrec - -instance Evaluatable TypeClassIdentifier - -newtype VariableIdentifier a = VariableIdentifier { variableIdentifierName :: Name } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 VariableIdentifier where liftEq = genericLiftEq -instance Ord1 VariableIdentifier where liftCompare = genericLiftCompare -instance Show1 VariableIdentifier where liftShowsPrec = genericLiftShowsPrec - -instance Evaluatable VariableIdentifier - -newtype PrimitiveConstructorIdentifier a = PrimitiveConstructorIdentifier { primitiveConstructorIdentifierName :: Name } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 PrimitiveConstructorIdentifier where liftEq = genericLiftEq -instance Ord1 PrimitiveConstructorIdentifier where liftCompare = genericLiftCompare -instance Show1 PrimitiveConstructorIdentifier where liftShowsPrec = genericLiftShowsPrec - -instance Evaluatable PrimitiveConstructorIdentifier +instance Evaluatable EntityIdentifier newtype ConstructorSymbol a = ConstructorSymbol { constructorSymbolName :: Name } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt index f9f5a0fab..81a5f83cb 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt @@ -62,9 +62,6 @@ ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) - {+(Constructor - {+(ConstructorIdentifier)+} - {+(TypeParameters)+})+} (Constructor { (ConstructorIdentifier) ->(ConstructorIdentifier) } @@ -81,6 +78,9 @@ {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} + {+(Constructor + {+(ConstructorIdentifier)+} + {+(TypeParameters)+})+} {-(Constructor {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} diff --git a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt index 99276a2b6..0e15597cc 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt @@ -62,9 +62,10 @@ ->(TypeConstructorIdentifier) } (TypeParameters) (Empty)) - {+(Constructor - {+(ConstructorIdentifier)+} - {+(TypeParameters)+})+} + (Constructor + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } + (TypeParameters)) {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} @@ -78,15 +79,10 @@ {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} - {+(Constructor - {+(ConstructorIdentifier)+} - {+(TypeParameters)+})+} - {-(Constructor - {-(ConstructorIdentifier)-} - {-(TypeParameters)-})-} - {-(Constructor - {-(ConstructorIdentifier)-} - {-(TypeParameters)-})-} + (Constructor + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } + (TypeParameters)) {-(Constructor {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} diff --git a/test/fixtures/haskell/corpus/literals.diffA-B.txt b/test/fixtures/haskell/corpus/literals.diffA-B.txt index 316dd79d5..4f0defa69 100644 --- a/test/fixtures/haskell/corpus/literals.diffA-B.txt +++ b/test/fixtures/haskell/corpus/literals.diffA-B.txt @@ -1,11 +1,10 @@ (Module (ModuleIdentifier) (Statements - (Function - { (VariableIdentifier) - ->(VariableIdentifier) } - (Statements - (Integer))) + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Integer)+})+})+} {+(Function {+(VariableIdentifier)+} {+(Statements @@ -284,6 +283,10 @@ {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(Integer)-})-})-} {-(Function {-(VariableIdentifier)-} {-(Statements diff --git a/test/fixtures/haskell/corpus/literals.diffB-A.txt b/test/fixtures/haskell/corpus/literals.diffB-A.txt index 9c3428b9d..aec6b2b9f 100644 --- a/test/fixtures/haskell/corpus/literals.diffB-A.txt +++ b/test/fixtures/haskell/corpus/literals.diffB-A.txt @@ -1,11 +1,10 @@ (Module (ModuleIdentifier) (Statements - (Function - { (VariableIdentifier) - ->(VariableIdentifier) } - (Statements - (Integer))) + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Integer)+})+})+} {+(Function {+(VariableIdentifier)+} {+(Statements @@ -118,34 +117,6 @@ {+(VariableIdentifier)+} {+(Statements {+(ConstructorIdentifier)+})+})+} - {+(Function - {+(VariableIdentifier)+} - {+(Statements - {+(Character)+})+})+} - {+(Function - {+(VariableIdentifier)+} - {+(Statements - {+(Character)+})+})+} - {+(Function - {+(VariableIdentifier)+} - {+(Statements - {+(Character)+})+})+} - {+(Function - {+(VariableIdentifier)+} - {+(Statements - {+(Character)+})+})+} - {+(Function - {+(VariableIdentifier)+} - {+(Statements - {+(Character)+})+})+} - {+(Function - {+(VariableIdentifier)+} - {+(Statements - {+(Character)+})+})+} - {+(Function - {+(VariableIdentifier)+} - {+(Statements - {+(Character)+})+})+} {+(Function {+(VariableIdentifier)+} {+(Statements @@ -228,6 +199,34 @@ {+(VariableIdentifier)+} {+(Statements {+(Character)+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Character)+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Character)+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Character)+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Character)+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Character)+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Character)+})+})+} + {+(Function + {+(VariableIdentifier)+} + {+(Statements + {+(Character)+})+})+} {+(Function {+(VariableIdentifier)+} {+(Statements @@ -282,6 +281,10 @@ {-(VariableIdentifier)-} {-(Statements {-(Integer)-})-})-} + {-(Function + {-(VariableIdentifier)-} + {-(Statements + {-(Integer)-})-})-} {-(Function {-(VariableIdentifier)-} {-(Statements diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt b/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt index 11e9f58b4..8716e6a76 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt @@ -126,111 +126,66 @@ (TypeConstructorIdentifier) (TypeVariableIdentifier))) (Empty)))))) - {+(TypeSynonym - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(TypeConstructorIdentifier)+})+} - {+(TextElement)+})+} - {+(TypeSynonym - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(TypeVariableIdentifier)+} - {+(TypeVariableIdentifier)+})+})+} - {+(TypePattern - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(TypeVariableIdentifier)+} - {+(TypeVariableIdentifier)+})+})+})+} - {+(TypeSynonym - {+(Statements - {+(TypeConstructorIdentifier)+})+} - {+(Context' - {+(Statements - {+(TypeConstructorIdentifier)+})+})+} - {+(TypePattern - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(ListConstructor)+})+})+})+} - {+(TypeSynonym - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(TypeVariableIdentifier)+} - {+(TypeVariableIdentifier)+})+} - {+(ScopedTypeVariables - {+(Statements - {+(TypeVariableIdentifier)+} - {+(TypeVariableIdentifier)+})+})+} - {+(TypePattern - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(TypeVariableIdentifier)+} - {+(TypeVariableIdentifier)+})+})+})+} - {+(TypeSynonym - {+(Statements - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(TypeVariableIdentifier)+} - {+(TypeVariableIdentifier)+})+})+} - {+(TypePattern - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(TypeVariableIdentifier)+} - {+(TypeVariableIdentifier)+})+})+})+})+} - {-(TypeSynonym - {-(Statements + (TypeSynonym + (Statements {-(TypeConstructorIdentifier)-} - {-(TypeConstructorIdentifier)-})-} - {-(TextElement)-})-} - {-(TypeSynonym - {-(Statements - {-(TypeConstructorIdentifier)-} - {-(Statements - {-(TypeConstructorIdentifier)-} - {-(TypeVariableIdentifier)-} - {-(TypeVariableIdentifier)-})-})-} - {-(TypePattern - {-(Statements - {-(TypeConstructorIdentifier)-} - {-(TypeVariableIdentifier)-} - {-(TypeVariableIdentifier)-})-})-})-} - {-(TypeSynonym - {-(Statements - {-(TypeConstructorIdentifier)-})-} - {-(Context' - {-(Statements - {-(TypeConstructorIdentifier)-})-})-} - {-(TypePattern - {-(Statements - {-(TypeConstructorIdentifier)-} - {-(ListConstructor)-})-})-})-} - {-(TypeSynonym - {-(Statements - {-(TypeConstructorIdentifier)-} - {-(TypeVariableIdentifier)-} - {-(TypeVariableIdentifier)-})-} - {-(ScopedTypeVariables - {-(Statements - {-(TypeVariableIdentifier)-} - {-(TypeVariableIdentifier)-})-})-} - {-(TypePattern - {-(Statements - {-(TypeConstructorIdentifier)-} - {-(TypeVariableIdentifier)-} - {-(TypeVariableIdentifier)-})-})-})-} - {-(TypeSynonym - {-(Statements - {-(Statements - {-(TypeConstructorIdentifier)-} - {-(TypeVariableIdentifier)-} - {-(TypeVariableIdentifier)-})-})-} - {-(TypePattern - {-(Statements - {-(TypeConstructorIdentifier)-} - {-(Statements - {-(TypeConstructorIdentifier)-} - {-(TypeVariableIdentifier)-} - {-(TypeVariableIdentifier)-})-})-})-})-})) + (TypeConstructorIdentifier) + {+(TypeConstructorIdentifier)+}) + (TextElement)) + (TypeSynonym + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (TypePattern + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + (TypeSynonym + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) }) + (Context' + (Statements + (TypeConstructorIdentifier))) + (TypePattern + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (ListConstructor)))) + (TypeSynonym + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier)) + (ScopedTypeVariables + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (TypePattern + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier)))) + (TypeSynonym + (Statements + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (TypePattern + (Statements + (TypeConstructorIdentifier) + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (TypeVariableIdentifier))))))) diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt index 2861353eb..2db9cebc4 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt @@ -114,14 +114,11 @@ {+(TypeConstructorIdentifier)+} {+(TypeVariableIdentifier)+})+})+} {+(Empty)+})+})+})+})+})+} - (TypeSynonym - (Statements - { (TypeConstructorIdentifier) - ->(TypeConstructorIdentifier) } - {+(TypeConstructorIdentifier)+}) - { (TypePattern - {-(TupleConstructor)-}) - ->(TextElement) }) + {+(TypeSynonym + {+(Statements + {+(TypeConstructorIdentifier)+} + {+(TypeConstructorIdentifier)+})+} + {+(TextElement)+})+} {+(TypeSynonym {+(Statements {+(TypeConstructorIdentifier)+} @@ -171,6 +168,11 @@ {+(TypeConstructorIdentifier)+} {+(TypeVariableIdentifier)+} {+(TypeVariableIdentifier)+})+})+})+})+} + {-(TypeSynonym + {-(Statements + {-(TypeConstructorIdentifier)-})-} + {-(TypePattern + {-(TupleConstructor)-})-})-} {-(TypeSynonym {-(Statements {-(TypeConstructorIdentifier)-})-} From 2048c2338351d5eab41b3f24620a70d45b7be58b Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Mon, 11 Jun 2018 10:27:14 -0700 Subject: [PATCH 12/12] Add Operator constructor --- src/Language/Haskell/Assignment.hs | 4 +--- src/Language/Haskell/Syntax.hs | 38 +++++++++--------------------- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/src/Language/Haskell/Assignment.hs b/src/Language/Haskell/Assignment.hs index abb2a844f..52ca72751 100644 --- a/src/Language/Haskell/Assignment.hs +++ b/src/Language/Haskell/Assignment.hs @@ -38,7 +38,6 @@ type Syntax = '[ , Syntax.AllConstructors , Syntax.AnnotatedTypeVariable , Syntax.Class - , Syntax.ConstructorOperator , Syntax.ConstructorSymbol , Syntax.Context , Syntax.Context' @@ -64,6 +63,7 @@ type Syntax = '[ , Syntax.Module , Syntax.ModuleExport , Syntax.NewType + , Syntax.Operator , Syntax.Pragma , Syntax.QualifiedModuleIdentifier , Syntax.QualifiedTypeConstructorIdentifier @@ -76,12 +76,10 @@ type Syntax = '[ , Syntax.TupleConstructor , Syntax.Type , Syntax.TypeConstructorExport - , Syntax.TypeOperator , Syntax.TypePattern , Syntax.TypeSignature , Syntax.TypeSynonym , Syntax.UnitConstructor - , Syntax.VariableOperator , Syntax.VariableSymbol , Type.TypeParameters , [] diff --git a/src/Language/Haskell/Syntax.hs b/src/Language/Haskell/Syntax.hs index ae0b2c402..b4d1fa691 100644 --- a/src/Language/Haskell/Syntax.hs +++ b/src/Language/Haskell/Syntax.hs @@ -281,15 +281,6 @@ instance Show1 TypeConstructorExport where liftShowsPrec = genericLiftShowsPrec instance Evaluatable TypeConstructorExport -newtype VariableOperator a = VariableOperator { variableOperatorContent :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 VariableOperator where liftEq = genericLiftEq -instance Ord1 VariableOperator where liftCompare = genericLiftCompare -instance Show1 VariableOperator where liftShowsPrec = genericLiftShowsPrec - -instance Evaluatable VariableOperator - data AllConstructors a = AllConstructors deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) @@ -299,15 +290,6 @@ instance Show1 AllConstructors where liftShowsPrec = genericLiftShowsPrec instance Evaluatable AllConstructors -newtype ConstructorOperator a = ConstructorOperator { constructorOperatorContent :: a } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 ConstructorOperator where liftEq = genericLiftEq -instance Ord1 ConstructorOperator where liftCompare = genericLiftCompare -instance Show1 ConstructorOperator where liftShowsPrec = genericLiftShowsPrec - -instance Evaluatable ConstructorOperator - data InfixOperatorPattern a = InfixOperatorPattern { infixOperatorPatternLeft :: a, infixOperatorPatternOperator :: a, infixOperatorPatternRight :: a } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) @@ -386,6 +368,17 @@ instance Show1 EntityIdentifier where liftShowsPrec = genericLiftShowsPrec instance Evaluatable EntityIdentifier +data Operator a = VariableOperator a + | ConstructorOperator a + | TypeOperator Name + deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) + +instance Eq1 Operator where liftEq = genericLiftEq +instance Ord1 Operator where liftCompare = genericLiftCompare +instance Show1 Operator where liftShowsPrec = genericLiftShowsPrec + +instance Evaluatable Operator + newtype ConstructorSymbol a = ConstructorSymbol { constructorSymbolName :: Name } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) @@ -395,15 +388,6 @@ instance Show1 ConstructorSymbol where liftShowsPrec = genericLiftShowsPrec instance Evaluatable ConstructorSymbol -newtype TypeOperator a = TypeOperator { typeOperatorName :: Name } - deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable) - -instance Eq1 TypeOperator where liftEq = genericLiftEq -instance Ord1 TypeOperator where liftCompare = genericLiftCompare -instance Show1 TypeOperator where liftShowsPrec = genericLiftShowsPrec - -instance Evaluatable TypeOperator - newtype VariableSymbol a = VariableSymbol { variableSymbolName :: Name } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable)