From 21526b78ff943c478dd175555fe7e47109f8963b Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Mon, 18 Jun 2018 12:34:27 -0700 Subject: [PATCH] Add type class declaration fixtures --- ...lgebraic-datatype-declarations.diffA-B.txt | 20 +- ...lgebraic-datatype-declarations.diffB-A.txt | 10 +- .../corpus/type-class-declarations.A.hs | 48 ++ .../corpus/type-class-declarations.B.hs | 48 ++ .../type-class-declarations.diffA-B.txt | 594 +++++++++++++++++ .../type-class-declarations.diffB-A.txt | 597 ++++++++++++++++++ .../corpus/type-class-declarations.parseA.txt | 341 ++++++++++ .../corpus/type-class-declarations.parseB.txt | 341 ++++++++++ .../haskell/corpus/type-synonyms.diffA-B.txt | 14 +- .../haskell/corpus/type-synonyms.diffB-A.txt | 34 +- 10 files changed, 2002 insertions(+), 45 deletions(-) create mode 100644 test/fixtures/haskell/corpus/type-class-declarations.A.hs create mode 100644 test/fixtures/haskell/corpus/type-class-declarations.B.hs create mode 100644 test/fixtures/haskell/corpus/type-class-declarations.diffA-B.txt create mode 100644 test/fixtures/haskell/corpus/type-class-declarations.diffB-A.txt create mode 100644 test/fixtures/haskell/corpus/type-class-declarations.parseA.txt create mode 100644 test/fixtures/haskell/corpus/type-class-declarations.parseB.txt 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 465cdc81d..de7e31ab3 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffA-B.txt @@ -69,24 +69,20 @@ {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} + (Constructor + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } + (TypeParameters)) {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} - {+(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/algebraic-datatype-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt index 3054526c2..05c4b0e21 100644 --- a/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt +++ b/test/fixtures/haskell/corpus/algebraic-datatype-declarations.diffB-A.txt @@ -75,15 +75,13 @@ {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} + (Constructor + { (ConstructorIdentifier) + ->(ConstructorIdentifier) } + (TypeParameters)) {+(Constructor {+(ConstructorIdentifier)+} {+(TypeParameters)+})+} - {+(Constructor - {+(ConstructorIdentifier)+} - {+(TypeParameters)+})+} - {-(Constructor - {-(ConstructorIdentifier)-} - {-(TypeParameters)-})-} {-(Constructor {-(ConstructorIdentifier)-} {-(TypeParameters)-})-} diff --git a/test/fixtures/haskell/corpus/type-class-declarations.A.hs b/test/fixtures/haskell/corpus/type-class-declarations.A.hs new file mode 100644 index 000000000..fc579e462 --- /dev/null +++ b/test/fixtures/haskell/corpus/type-class-declarations.A.hs @@ -0,0 +1,48 @@ +class Show a where {} +class Show a b where {} + +class Show a => Read a where {} +class (Show a, Eq a) => Read a where {} + +class Foo a where { + op :: Num b => a -> b -> a; + op' :: (Num a, Num b) => a -> b -> a; +} + +class Foo a where + infixl `op` + infixr 7 `op` + infix 7 `op`, `ip`, `ap` + infix <$> + infix 7 <$> + infix 7 : + infix 7 :. + infix 7 :<: + +class (Eq a) => Ord a where + compare :: a -> a -> Ordering + (<), (<=), (>=), (>) :: a -> a -> Bool + max, min :: a -> a -> a + id :: a + +class Bar a b m => Baz a b m where {} + +class Bar baz where + foo :: wiz -> Baz + default foo :: wiz -> Baz + +class Bar (baz :: Foo) where + +class Effectful (m :: [* -> *] -> * -> *) where + +class Foo bar where + type Baz wiz :: Wax + +class Foo bar where + type Baz wiz :: [* -> *] + +class Bar baz => Foo fax where + type family Woo a :: [* -> *] + +class (Monad a, Show b) => Foo a b c | a -> c, b -> c where + d :: a b diff --git a/test/fixtures/haskell/corpus/type-class-declarations.B.hs b/test/fixtures/haskell/corpus/type-class-declarations.B.hs new file mode 100644 index 000000000..46f847feb --- /dev/null +++ b/test/fixtures/haskell/corpus/type-class-declarations.B.hs @@ -0,0 +1,48 @@ +class Eq a where {} +class Ord a b where {} + +class Eq a => Ord a where {} +class (Show a, Eq a) => Ord a where {} + +class Bar a where { + op' :: Num b => a -> b -> a; + op :: (Num a, Num b) => a -> b -> a; +} + +class Bar a where + infixl `op` + infixr 8 `op` + infix 8 `op`, `ip`, `ap` + infix <$> + infix 8 <$> + infix 8 : + infix 8 :. + infix 8 :<: + +class (Eq b) => Ord b where + compare :: b -> b -> Ordering + (<), (<=), (>=), (>) :: b -> b -> Bool + max, min :: b -> b -> b + id :: b + +class Foo a b m => Bar a b m where {} + +class Foo bat where + bar :: bat -> Baz + default bar :: bat -> Baz + +class Foo (baz :: Bar) where + +class Effectful' (m' :: [* -> *] -> * -> *) where + +class Foo bar where + type Baz wiz :: Wax + +class Foo bar where + type Baz wiz :: [* -> *] + +class Foo baz => Bar fax where + type family Woot a :: [* -> *] + +class (Monad a, Show b) => Foo a b c | b -> d, a -> b where + d :: a b diff --git a/test/fixtures/haskell/corpus/type-class-declarations.diffA-B.txt b/test/fixtures/haskell/corpus/type-class-declarations.diffA-B.txt new file mode 100644 index 000000000..11f8d9919 --- /dev/null +++ b/test/fixtures/haskell/corpus/type-class-declarations.diffA-B.txt @@ -0,0 +1,594 @@ +(Module + (Empty) + (Statements + (TypeClass + (Empty) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier) + (Statements)) + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements)+})+} + {+(TypeClass + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements)+})+} + {+(TypeClass + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements)+})+} + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+})+})+} + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(Fixity' + {+(Empty)+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+})+} + {+(Fixity' + {+(Empty)+} + {+(VariableOperator + {+(VariableSymbol)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(VariableOperator + {+(VariableSymbol)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+})+})+})+} + {+(TypeClass + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(TypeClass + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements)+})+} + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(DefaultSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+})+} + (TypeClass + (Empty) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + {+(AnnotatedTypeVariable + {+(TypeVariableIdentifier)+} + {+(TypeConstructorIdentifier)+})+} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-} + (Statements)) + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(AnnotatedTypeVariable + {+(TypeVariableIdentifier)+} + {+(KindFunctionType + {+(Kind + {+(KindListType + {+(KindFunctionType + {+(Kind + {+(Star)+})+} + {+(Kind + {+(Star)+})+})+})+})+} + {+(KindFunctionType + {+(Kind + {+(Star)+})+} + {+(Kind + {+(Star)+})+})+})+})+} + {+(Statements)+})+} + {-(TypeClass + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements)-})-} + {-(TypeClass + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements)-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-})-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(Fixity' + {-(Empty)-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-})-} + {-(Fixity' + {-(Empty)-} + {-(VariableOperator + {-(VariableSymbol)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(VariableOperator + {-(VariableSymbol)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-})-})-})-} + {-(TypeClass + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(TypeClass + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements)-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(DefaultSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(AnnotatedTypeVariable + {-(TypeVariableIdentifier)-} + {-(TypeConstructorIdentifier)-})-} + {-(Statements)-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(AnnotatedTypeVariable + {-(TypeVariableIdentifier)-} + {-(KindFunctionType + {-(Kind + {-(KindListType + {-(KindFunctionType + {-(Kind + {-(Star)-})-} + {-(Kind + {-(Star)-})-})-})-})-} + {-(KindFunctionType + {-(Kind + {-(Star)-})-} + {-(Kind + {-(Star)-})-})-})-})-} + {-(Statements)-})-} + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSynonym + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (TypeSignature + (TypeConstructorIdentifier))))) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSynonym + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (KindSignature + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star)))))))) + (TypeClass + (Context' + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier))) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier) + (Statements + (TypeFamily + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (KindSignature + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Empty)))) + (TypeClass + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (FunctionalDependency + (Statements + (FunctionType + (Type + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) } + (TypeParameters) + (Empty)) + (Type + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) } + (TypeParameters) + (Empty))) + (FunctionType + (Type + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) } + (TypeParameters) + (Empty)) + (Type + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) } + (TypeParameters) + (Empty))))) + (Statements + (TypeSignature + (VariableIdentifier) + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))))))) diff --git a/test/fixtures/haskell/corpus/type-class-declarations.diffB-A.txt b/test/fixtures/haskell/corpus/type-class-declarations.diffB-A.txt new file mode 100644 index 000000000..2d5c8d362 --- /dev/null +++ b/test/fixtures/haskell/corpus/type-class-declarations.diffB-A.txt @@ -0,0 +1,597 @@ +(Module + (Empty) + (Statements + (TypeClass + (Empty) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier) + (Statements)) + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements)+})+} + {+(TypeClass + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements)+})+} + {+(TypeClass + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements)+})+} + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(Context' + {+(Statements + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+} + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+})+})+} + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(Fixity' + {+(Empty)+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+} + {+(VariableOperator + {+(InfixVariableIdentifier)+})+})+} + {+(Fixity' + {+(Empty)+} + {+(VariableOperator + {+(VariableSymbol)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(VariableOperator + {+(VariableSymbol)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+})+} + {+(Fixity' + {+(Integer)+} + {+(ConstructorOperator + {+(ConstructorSymbol)+})+})+})+})+} + {+(TypeClass + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(VariableOperator + {+(VariableSymbol)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+} + {+(TypeSignature + {+(VariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+})+} + {+(TypeClass + {+(Context' + {+(Class + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+})+})+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements)+})+} + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(TypeVariableIdentifier)+} + {+(Statements + {+(TypeSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+} + {+(DefaultSignature + {+(VariableIdentifier)+} + {+(FunctionType + {+(Type + {+(TypeVariableIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+} + {+(Type + {+(TypeConstructorIdentifier)+} + {+(TypeParameters)+} + {+(Empty)+})+})+})+})+})+} + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(AnnotatedTypeVariable + {+(TypeVariableIdentifier)+} + {+(TypeConstructorIdentifier)+})+} + {+(Statements)+})+} + {+(TypeClass + {+(Empty)+} + {+(TypeClassIdentifier)+} + {+(AnnotatedTypeVariable + {+(TypeVariableIdentifier)+} + {+(KindFunctionType + {+(Kind + {+(KindListType + {+(KindFunctionType + {+(Kind + {+(Star)+})+} + {+(Kind + {+(Star)+})+})+})+})+} + {+(KindFunctionType + {+(Kind + {+(Star)+})+} + {+(Kind + {+(Star)+})+})+})+})+} + {+(Statements)+})+} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements)-})-} + {-(TypeClass + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements)-})-} + {-(TypeClass + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements)-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(Context' + {-(Statements + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-} + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-})-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(Fixity' + {-(Empty)-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-} + {-(VariableOperator + {-(InfixVariableIdentifier)-})-})-} + {-(Fixity' + {-(Empty)-} + {-(VariableOperator + {-(VariableSymbol)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(VariableOperator + {-(VariableSymbol)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-})-} + {-(Fixity' + {-(Integer)-} + {-(ConstructorOperator + {-(ConstructorSymbol)-})-})-})-})-} + {-(TypeClass + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(VariableOperator + {-(VariableSymbol)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-} + {-(TypeSignature + {-(VariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-})-} + {-(TypeClass + {-(Context' + {-(Class + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-})-})-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements)-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(TypeVariableIdentifier)-} + {-(Statements + {-(TypeSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-} + {-(DefaultSignature + {-(VariableIdentifier)-} + {-(FunctionType + {-(Type + {-(TypeVariableIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-} + {-(Type + {-(TypeConstructorIdentifier)-} + {-(TypeParameters)-} + {-(Empty)-})-})-})-})-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(AnnotatedTypeVariable + {-(TypeVariableIdentifier)-} + {-(TypeConstructorIdentifier)-})-} + {-(Statements)-})-} + {-(TypeClass + {-(Empty)-} + {-(TypeClassIdentifier)-} + {-(AnnotatedTypeVariable + {-(TypeVariableIdentifier)-} + {-(KindFunctionType + {-(Kind + {-(KindListType + {-(KindFunctionType + {-(Kind + {-(Star)-})-} + {-(Kind + {-(Star)-})-})-})-})-} + {-(KindFunctionType + {-(Kind + {-(Star)-})-} + {-(Kind + {-(Star)-})-})-})-})-} + {-(Statements)-})-} + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSynonym + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (TypeSignature + (TypeConstructorIdentifier))))) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSynonym + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (KindSignature + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star)))))))) + (TypeClass + (Context' + (Class + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier))) + { (TypeClassIdentifier) + ->(TypeClassIdentifier) } + (TypeVariableIdentifier) + (Statements + (TypeFamily + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + (TypeVariableIdentifier) + (KindSignature + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Empty)))) + (TypeClass + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (FunctionalDependency + (Statements + (FunctionType + (Type + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) } + (TypeParameters) + (Empty)) + (Type + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) } + (TypeParameters) + (Empty))) + (FunctionType + (Type + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) } + (TypeParameters) + (Empty)) + (Type + { (TypeVariableIdentifier) + ->(TypeVariableIdentifier) } + (TypeParameters) + (Empty))))) + (Statements + (TypeSignature + (VariableIdentifier) + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))))))) diff --git a/test/fixtures/haskell/corpus/type-class-declarations.parseA.txt b/test/fixtures/haskell/corpus/type-class-declarations.parseA.txt new file mode 100644 index 000000000..daed18760 --- /dev/null +++ b/test/fixtures/haskell/corpus/type-class-declarations.parseA.txt @@ -0,0 +1,341 @@ +(Module + (Empty) + (Statements + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSignature + (VariableIdentifier) + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))))) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (Fixity' + (Empty) + (VariableOperator + (InfixVariableIdentifier))) + (Fixity' + (Integer) + (VariableOperator + (InfixVariableIdentifier))) + (Fixity' + (Integer) + (VariableOperator + (InfixVariableIdentifier)) + (VariableOperator + (InfixVariableIdentifier)) + (VariableOperator + (InfixVariableIdentifier))) + (Fixity' + (Empty) + (VariableOperator + (VariableSymbol))) + (Fixity' + (Integer) + (VariableOperator + (VariableSymbol))) + (Fixity' + (Integer) + (ConstructorOperator + (ConstructorSymbol))) + (Fixity' + (Integer) + (ConstructorOperator + (ConstructorSymbol))) + (Fixity' + (Integer) + (ConstructorOperator + (ConstructorSymbol))))) + (TypeClass + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableOperator + (VariableSymbol)) + (VariableOperator + (VariableSymbol)) + (VariableOperator + (VariableSymbol)) + (VariableOperator + (VariableSymbol)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (TypeVariableIdentifier)))) + (TypeClass + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)))) + (DefaultSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)))))) + (TypeClass + (Empty) + (TypeClassIdentifier) + (AnnotatedTypeVariable + (TypeVariableIdentifier) + (TypeConstructorIdentifier)) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (AnnotatedTypeVariable + (TypeVariableIdentifier) + (KindFunctionType + (Kind + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSynonym + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (TypeSignature + (TypeConstructorIdentifier))))) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSynonym + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (KindSignature + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star)))))))) + (TypeClass + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeFamily + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (KindSignature + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Empty)))) + (TypeClass + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (FunctionalDependency + (Statements + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (Statements + (TypeSignature + (VariableIdentifier) + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))))))) diff --git a/test/fixtures/haskell/corpus/type-class-declarations.parseB.txt b/test/fixtures/haskell/corpus/type-class-declarations.parseB.txt new file mode 100644 index 000000000..daed18760 --- /dev/null +++ b/test/fixtures/haskell/corpus/type-class-declarations.parseB.txt @@ -0,0 +1,341 @@ +(Module + (Empty) + (Statements + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSignature + (VariableIdentifier) + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))))) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (Fixity' + (Empty) + (VariableOperator + (InfixVariableIdentifier))) + (Fixity' + (Integer) + (VariableOperator + (InfixVariableIdentifier))) + (Fixity' + (Integer) + (VariableOperator + (InfixVariableIdentifier)) + (VariableOperator + (InfixVariableIdentifier)) + (VariableOperator + (InfixVariableIdentifier))) + (Fixity' + (Empty) + (VariableOperator + (VariableSymbol))) + (Fixity' + (Integer) + (VariableOperator + (VariableSymbol))) + (Fixity' + (Integer) + (ConstructorOperator + (ConstructorSymbol))) + (Fixity' + (Integer) + (ConstructorOperator + (ConstructorSymbol))) + (Fixity' + (Integer) + (ConstructorOperator + (ConstructorSymbol))))) + (TypeClass + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableOperator + (VariableSymbol)) + (VariableOperator + (VariableSymbol)) + (VariableOperator + (VariableSymbol)) + (VariableOperator + (VariableSymbol)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (TypeSignature + (VariableIdentifier) + (TypeVariableIdentifier)))) + (TypeClass + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)))) + (DefaultSignature + (VariableIdentifier) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeConstructorIdentifier) + (TypeParameters) + (Empty)))))) + (TypeClass + (Empty) + (TypeClassIdentifier) + (AnnotatedTypeVariable + (TypeVariableIdentifier) + (TypeConstructorIdentifier)) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (AnnotatedTypeVariable + (TypeVariableIdentifier) + (KindFunctionType + (Kind + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Statements)) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSynonym + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (TypeSignature + (TypeConstructorIdentifier))))) + (TypeClass + (Empty) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeSynonym + (Statements + (TypeConstructorIdentifier) + (TypeVariableIdentifier)) + (KindSignature + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star)))))))) + (TypeClass + (Context' + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (Statements + (TypeFamily + (TypeConstructorIdentifier) + (TypeVariableIdentifier) + (KindSignature + (KindListType + (KindFunctionType + (Kind + (Star)) + (Kind + (Star))))) + (Empty)))) + (TypeClass + (Context' + (Statements + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)) + (Class + (TypeClassIdentifier) + (TypeVariableIdentifier)))) + (TypeClassIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (TypeVariableIdentifier) + (FunctionalDependency + (Statements + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))) + (FunctionType + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty)) + (Type + (TypeVariableIdentifier) + (TypeParameters) + (Empty))))) + (Statements + (TypeSignature + (VariableIdentifier) + (Statements + (TypeVariableIdentifier) + (TypeVariableIdentifier))))))) diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt b/test/fixtures/haskell/corpus/type-synonyms.diffA-B.txt index bcfd0ab5f..4fff50387 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 @@ (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) + (TypeSynonym + (Statements + (TypeConstructorIdentifier)) + (TypePattern + { (FunctionConstructor) + ->(TupleConstructor) })) {+(TypeSynonym {+(Statements {+(TypeConstructorIdentifier)+})+} {+(TypePattern - {+(TupleConstructor)+})+})+} - (TypeSynonym - (Statements - { (TypeConstructorIdentifier) - ->(TypeConstructorIdentifier) }) - (TypePattern - (FunctionConstructor))) + {+(FunctionConstructor)+})+})+} (TypeSynonym (Statements (TypeConstructorIdentifier)) diff --git a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt index e098b46e7..d03474db8 100644 --- a/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt +++ b/test/fixtures/haskell/corpus/type-synonyms.diffB-A.txt @@ -52,11 +52,12 @@ (TypeConstructorIdentifier)) (TypePattern (TupleConstructor))) - {+(TypeSynonym - {+(Statements - {+(TypeConstructorIdentifier)+})+} - {+(TypePattern - {+(FunctionConstructor)+})+})+} + (TypeSynonym + (Statements + (TypeConstructorIdentifier)) + (TypePattern + { (TupleConstructor) + ->(FunctionConstructor) })) {+(TypeSynonym {+(Statements {+(TypeConstructorIdentifier)+})+} @@ -114,11 +115,14 @@ {+(TypeConstructorIdentifier)+} {+(TypeVariableIdentifier)+})+})+} {+(Empty)+})+})+})+})+})+} - {+(TypeSynonym - {+(Statements - {+(TypeConstructorIdentifier)+} - {+(TypeConstructorIdentifier)+})+} - {+(TextElement)+})+} + (TypeSynonym + (Statements + { (TypeConstructorIdentifier) + ->(TypeConstructorIdentifier) } + {+(TypeConstructorIdentifier)+}) + { (TypePattern + {-(FunctionConstructor)-}) + ->(TextElement) }) {+(TypeSynonym {+(Statements {+(TypeConstructorIdentifier)+} @@ -167,16 +171,6 @@ {+(TypeConstructorIdentifier)+} {+(TypeVariableIdentifier)+} {+(TypeVariableIdentifier)+})+})+})+})+} - {-(TypeSynonym - {-(Statements - {-(TypeConstructorIdentifier)-})-} - {-(TypePattern - {-(TupleConstructor)-})-})-} - {-(TypeSynonym - {-(Statements - {-(TypeConstructorIdentifier)-})-} - {-(TypePattern - {-(FunctionConstructor)-})-})-} {-(TypeSynonym {-(Statements {-(TypeConstructorIdentifier)-})-}