1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Merge branch 'master' into fix-maybe-language

This commit is contained in:
Patrick Thomson 2018-06-05 12:24:14 -04:00 committed by GitHub
commit c35d00bf93
11 changed files with 629 additions and 105 deletions

View File

@ -182,7 +182,7 @@ instance Evaluatable Decorator
-- | An ADT, i.e. a disjoint sum of products, like 'data' in Haskell, or 'enum' in Rust or Swift. -- | An ADT, i.e. a disjoint sum of products, like 'data' in Haskell, or 'enum' in Rust or Swift.
data Datatype a = Datatype { datatypeName :: !a, datatypeConstructors :: ![a] } data Datatype a = Datatype { datatypeContext :: a, datatypeName :: a, datatypeConstructors :: [a], datatypeDeriving :: a }
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 Data.Syntax.Declaration.Datatype where liftEq = genericLiftEq instance Eq1 Data.Syntax.Declaration.Datatype where liftEq = genericLiftEq

View File

@ -33,7 +33,10 @@ type Syntax = '[
, Literal.Float , Literal.Float
, Literal.Integer , Literal.Integer
, Literal.TextElement , Literal.TextElement
, Syntax.Class
, Syntax.Context , Syntax.Context
, Syntax.Context'
, Syntax.Deriving
, Syntax.Empty , Syntax.Empty
, Syntax.Error , Syntax.Error
, Syntax.Field , Syntax.Field
@ -77,7 +80,9 @@ expressionChoices = [
algebraicDatatypeDeclaration algebraicDatatypeDeclaration
, character , character
, comment , comment
, context'
, constructorIdentifier , constructorIdentifier
, derivingClause
, float , float
, functionConstructor , functionConstructor
, functionDeclaration , functionDeclaration
@ -105,9 +110,11 @@ algebraicDatatypeDeclaration :: Assignment
algebraicDatatypeDeclaration = makeTerm algebraicDatatypeDeclaration = makeTerm
<$> symbol AlgebraicDatatypeDeclaration <$> symbol AlgebraicDatatypeDeclaration
<*> children (Declaration.Datatype <*> children (Declaration.Datatype
<$> (makeTerm <$> location <*> (Syntax.Type <$> typeConstructor <*> typeParameters)) <$> (context' <|> emptyTerm)
<*> (makeTerm <$> location <*> (Syntax.Type <$> typeConstructor <*> typeParameters))
<*> ((symbol Constructors *> children (many constructor)) <*> ((symbol Constructors *> children (many constructor))
<|> pure [])) <|> pure [])
<*> (derivingClause <|> emptyTerm))
comment :: Assignment comment :: Assignment
comment = makeTerm <$> symbol Comment <*> (Comment.Comment <$> source) comment = makeTerm <$> symbol Comment <*> (Comment.Comment <$> source)
@ -116,6 +123,18 @@ constructor :: Assignment
constructor = (makeTerm <$> symbol DataConstructor <*> children (Declaration.Constructor <$> typeConstructor <*> typeParameters)) constructor = (makeTerm <$> symbol DataConstructor <*> children (Declaration.Constructor <$> typeConstructor <*> typeParameters))
<|> (makeTerm <$> symbol RecordDataConstructor <*> children (Syntax.RecordDataConstructor <$> constructorIdentifier <*> fields)) <|> (makeTerm <$> symbol RecordDataConstructor <*> children (Syntax.RecordDataConstructor <$> constructorIdentifier <*> fields))
class' :: Assignment
class' = makeTerm <$> symbol Class <*> children (Syntax.Class <$> typeConstructor <*> typeParameters)
context' :: Assignment
context' = makeTerm <$> symbol Context <*> children (Syntax.Context' <$> many (type' <|> contextPattern))
contextPattern :: Assignment
contextPattern = symbol ContextPattern *> children type'
derivingClause :: Assignment
derivingClause = makeTerm <$> symbol Deriving <*> children (Syntax.Deriving <$> many typeConstructor)
fields :: Assignment fields :: Assignment
fields = makeTerm <$> symbol Fields <*> children (many field) fields = makeTerm <$> symbol Fields <*> children (many field)
@ -134,6 +153,9 @@ constructorIdentifier = makeTerm <$> symbol ConstructorIdentifier <*> (Syntax.Id
moduleIdentifier :: Assignment moduleIdentifier :: Assignment
moduleIdentifier = makeTerm <$> symbol ModuleIdentifier <*> (Syntax.Identifier . Name.name <$> source) moduleIdentifier = makeTerm <$> symbol ModuleIdentifier <*> (Syntax.Identifier . Name.name <$> source)
typeClassIdentifier :: Assignment
typeClassIdentifier = makeTerm <$> symbol TypeClassIdentifier <*> (Syntax.Identifier . Name.name <$> source)
typeConstructorIdentifier :: Assignment typeConstructorIdentifier :: Assignment
typeConstructorIdentifier = makeTerm <$> symbol TypeConstructorIdentifier <*> (Syntax.Identifier . Name.name <$> source) typeConstructorIdentifier = makeTerm <$> symbol TypeConstructorIdentifier <*> (Syntax.Identifier . Name.name <$> source)
@ -177,6 +199,9 @@ listExpression = makeTerm <$> symbol ListExpression <*> children (Literal.Array
listType :: Assignment listType :: Assignment
listType = makeTerm <$> symbol ListType <*> children (Literal.Array <$> many type') listType = makeTerm <$> symbol ListType <*> children (Literal.Array <$> many type')
parenthesizedTypePattern :: Assignment
parenthesizedTypePattern = symbol ParenthesizedTypePattern *> children typeParameters
strictType :: Assignment strictType :: Assignment
strictType = makeTerm' <$> symbol StrictType <*> children ((inject <$> (Syntax.StrictType <$> typeConstructor <*> typeParameters)) strictType = makeTerm' <$> symbol StrictType <*> children ((inject <$> (Syntax.StrictType <$> typeConstructor <*> typeParameters))
<|> (inject <$> (Syntax.StrictTypeVariable <$> typeVariableIdentifier))) <|> (inject <$> (Syntax.StrictTypeVariable <$> typeVariableIdentifier)))
@ -189,8 +214,10 @@ tuplingConstructor = makeTerm <$> symbol TuplingConstructor <*> (tupleWithArity
type' :: Assignment type' :: Assignment
type' = (makeTerm <$> symbol Type <*> children (Syntax.Type <$> typeConstructor <*> typeParameters)) type' = (makeTerm <$> symbol Type <*> children (Syntax.Type <$> typeConstructor <*> typeParameters))
<|> (makeTerm <$> symbol TypePattern <*> children (Syntax.Type <$> typeConstructor <*> typeParameters)) <|> (makeTerm <$> symbol TypePattern <*> children (Syntax.Type <$> typeConstructor <*> typeParameters))
<|> parenthesizedTypePattern
<|> strictType <|> strictType
<|> typeConstructor <|> typeConstructor
<|> class'
typeParameters :: Assignment typeParameters :: Assignment
typeParameters = makeTerm <$> location <*> (Type.TypeParameters <$> many expression) typeParameters = makeTerm <$> location <*> (Type.TypeParameters <$> many expression)
@ -205,13 +232,14 @@ string :: Assignment
string = makeTerm <$> symbol String <*> (Literal.TextElement <$> source) string = makeTerm <$> symbol String <*> (Literal.TextElement <$> source)
typeConstructor :: Assignment typeConstructor :: Assignment
typeConstructor = typeConstructorIdentifier typeConstructor = constructorIdentifier
<|> functionConstructor <|> functionConstructor
<|> listConstructor <|> listConstructor
<|> listType <|> listType
<|> typeClassIdentifier
<|> typeConstructorIdentifier
<|> tuplingConstructor <|> tuplingConstructor
<|> unitConstructor <|> unitConstructor
<|> constructorIdentifier
typeSynonymDeclaration :: Assignment typeSynonymDeclaration :: Assignment
typeSynonymDeclaration = makeTerm typeSynonymDeclaration = makeTerm

View File

@ -20,25 +20,21 @@ instance Show1 Module where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Module instance Evaluatable Module
data StrictType a = StrictType { strictTypeIdentifier :: !a, strictTypeParameters :: !a } data StrictType a = StrictType { strictTypeIdentifier :: !a, strictTypeParameters :: !a }
deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1) deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 StrictType where liftEq = genericLiftEq instance Eq1 StrictType where liftEq = genericLiftEq
instance Ord1 StrictType where liftCompare = genericLiftCompare instance Ord1 StrictType where liftCompare = genericLiftCompare
instance Show1 StrictType where liftShowsPrec = genericLiftShowsPrec instance Show1 StrictType where liftShowsPrec = genericLiftShowsPrec
instance ToJSONFields1 StrictType
instance Evaluatable StrictType instance Evaluatable StrictType
newtype StrictTypeVariable a = StrictTypeVariable { strictTypeVariableIdentifier :: a } newtype StrictTypeVariable a = StrictTypeVariable { strictTypeVariableIdentifier :: a }
deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1) deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 StrictTypeVariable where liftEq = genericLiftEq instance Eq1 StrictTypeVariable where liftEq = genericLiftEq
instance Ord1 StrictTypeVariable where liftCompare = genericLiftCompare instance Ord1 StrictTypeVariable where liftCompare = genericLiftCompare
instance Show1 StrictTypeVariable where liftShowsPrec = genericLiftShowsPrec instance Show1 StrictTypeVariable where liftShowsPrec = genericLiftShowsPrec
instance ToJSONFields1 StrictTypeVariable
instance Evaluatable StrictTypeVariable instance Evaluatable StrictTypeVariable
data Type a = Type { typeIdentifier :: !a, typeParameters :: !a } data Type a = Type { typeIdentifier :: !a, typeParameters :: !a }
@ -59,7 +55,8 @@ instance Show1 TypeSynonym where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable TypeSynonym instance Evaluatable TypeSynonym
data UnitConstructor a = UnitConstructor deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) data UnitConstructor a = UnitConstructor
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 UnitConstructor where liftEq = genericLiftEq instance Eq1 UnitConstructor where liftEq = genericLiftEq
instance Ord1 UnitConstructor where liftCompare = genericLiftCompare instance Ord1 UnitConstructor where liftCompare = genericLiftCompare
@ -67,7 +64,8 @@ instance Show1 UnitConstructor where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable UnitConstructor instance Evaluatable UnitConstructor
newtype TupleConstructor a = TupleConstructor { tupleConstructorArity :: Int } deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) newtype TupleConstructor a = TupleConstructor { tupleConstructorArity :: Int }
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 TupleConstructor where liftEq = genericLiftEq instance Eq1 TupleConstructor where liftEq = genericLiftEq
instance Ord1 TupleConstructor where liftCompare = genericLiftCompare instance Ord1 TupleConstructor where liftCompare = genericLiftCompare
@ -75,7 +73,8 @@ instance Show1 TupleConstructor where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable TupleConstructor instance Evaluatable TupleConstructor
data ListConstructor a = ListConstructor deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) data ListConstructor a = ListConstructor
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 ListConstructor where liftEq = genericLiftEq instance Eq1 ListConstructor where liftEq = genericLiftEq
instance Ord1 ListConstructor where liftCompare = genericLiftCompare instance Ord1 ListConstructor where liftCompare = genericLiftCompare
@ -83,7 +82,8 @@ instance Show1 ListConstructor where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable ListConstructor instance Evaluatable ListConstructor
data FunctionConstructor a = FunctionConstructor deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1) data FunctionConstructor a = FunctionConstructor
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 FunctionConstructor where liftEq = genericLiftEq instance Eq1 FunctionConstructor where liftEq = genericLiftEq
instance Ord1 FunctionConstructor where liftCompare = genericLiftCompare instance Ord1 FunctionConstructor where liftCompare = genericLiftCompare
@ -91,32 +91,56 @@ instance Show1 FunctionConstructor where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable FunctionConstructor instance Evaluatable FunctionConstructor
data RecordDataConstructor a = RecordDataConstructor { recordDataConstructorName :: !a, recordDataConstructorFields :: !a } deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1) data RecordDataConstructor a = RecordDataConstructor { recordDataConstructorName :: !a, recordDataConstructorFields :: !a }
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 RecordDataConstructor where liftEq = genericLiftEq instance Eq1 RecordDataConstructor where liftEq = genericLiftEq
instance Ord1 RecordDataConstructor where liftCompare = genericLiftCompare instance Ord1 RecordDataConstructor where liftCompare = genericLiftCompare
instance Show1 RecordDataConstructor where liftShowsPrec = genericLiftShowsPrec instance Show1 RecordDataConstructor where liftShowsPrec = genericLiftShowsPrec
instance ToJSONFields1 RecordDataConstructor
instance Evaluatable RecordDataConstructor instance Evaluatable RecordDataConstructor
data Field a = Field { fieldName :: !a, fieldBody :: !a } deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1) data Field a = Field { fieldName :: !a, fieldBody :: !a }
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 Field where liftEq = genericLiftEq instance Eq1 Field where liftEq = genericLiftEq
instance Ord1 Field where liftCompare = genericLiftCompare instance Ord1 Field where liftCompare = genericLiftCompare
instance Show1 Field where liftShowsPrec = genericLiftShowsPrec instance Show1 Field where liftShowsPrec = genericLiftShowsPrec
instance ToJSONFields1 Field
instance Evaluatable Field instance Evaluatable Field
newtype Pragma a = Pragma Text deriving (Diffable, Eq, Foldable, Functor, Generic1, Hashable1, Mergeable, Ord, Show, Traversable, FreeVariables1, Declarations1) newtype Pragma a = Pragma Text
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 Pragma where liftEq = genericLiftEq instance Eq1 Pragma where liftEq = genericLiftEq
instance Ord1 Pragma where liftCompare = genericLiftCompare instance Ord1 Pragma where liftCompare = genericLiftCompare
instance Show1 Pragma where liftShowsPrec = genericLiftShowsPrec instance Show1 Pragma where liftShowsPrec = genericLiftShowsPrec
instance ToJSONFields1 Pragma
instance Evaluatable Pragma instance Evaluatable Pragma
newtype Deriving a = Deriving [a]
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 Deriving where liftEq = genericLiftEq
instance Ord1 Deriving where liftCompare = genericLiftCompare
instance Show1 Deriving where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Deriving
newtype Context' a = Context' [a]
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 Context' where liftEq = genericLiftEq
instance Ord1 Context' where liftCompare = genericLiftCompare
instance Show1 Context' where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Context'
data Class a = Class { classType :: a, classTypeParameters :: a }
deriving (Eq, Ord, Show, Foldable, Traversable, Functor, Generic1, Hashable1, Diffable, Mergeable, FreeVariables1, Declarations1, ToJSONFields1)
instance Eq1 Class where liftEq = genericLiftEq
instance Ord1 Class where liftCompare = genericLiftCompare
instance Show1 Class where liftShowsPrec = genericLiftShowsPrec
instance Evaluatable Class

View File

@ -16,3 +16,10 @@ data N = N { a :: !Int, b :: Int }
data N = N { a, b :: {-# UNPACK #-} !Int, c :: String } data N = N { a, b :: {-# UNPACK #-} !Int, c :: String }
data N = N { a :: Int } | O { b :: String } data N = N { a :: Int } | O { b :: String }
data N = N { b :: Int } | O { c :: String } data N = N { b :: Int } | O { c :: String }
data N = N deriving Show
data N = N deriving (Eq, Ord, Enum, Bounded, Show, Read)
data Show a => N a = N a
data (Eq a, Show a, Eq b) => N a b = N a b
data (Eq (f a), Functor f) => N f a = N f a

View File

@ -16,3 +16,10 @@ data O = O { a :: !Int, b :: Int }
data O = O { a, b :: {-# UNPACK #-} !Int, c :: String } data O = O { a, b :: {-# UNPACK #-} !Int, c :: String }
data N = N { b :: Int } | O { c :: String } data N = N { b :: Int } | O { c :: String }
data N = N { b :: Text } | O { c :: Bool } data N = N { b :: Text } | O { c :: Bool }
data N = N deriving Show
data N = N deriving (Functor, Ord, Enum, Bounded, Show, Read)
data Monad a => N a = N a
data (Ord a, Show a, Eq b) => N a b = N a b
data (Eq (f a), Applicative f) => N f a = N f a

View File

@ -2,11 +2,14 @@
(Empty) (Empty)
(Statements (Statements
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
(TypeParameters))) (TypeParameters))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -16,8 +19,10 @@
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
(TypeParameters (TypeParameters
(Identifier)))) (Identifier)))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -28,8 +33,10 @@
->(Identifier) } ->(Identifier) }
(TypeParameters (TypeParameters
(StrictTypeVariable (StrictTypeVariable
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -42,8 +49,10 @@
(TypeParameters (TypeParameters
(StrictTypeVariable (StrictTypeVariable
(Identifier)) (Identifier))
(Identifier)))) (Identifier)))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -54,18 +63,20 @@
{+(Constructor {+(Constructor
{+(Identifier)+} {+(Identifier)+}
{+(TypeParameters)+})+} {+(TypeParameters)+})+}
(Constructor
{ (Identifier)
->(Identifier) }
(TypeParameters))
{+(Constructor {+(Constructor
{+(Identifier)+} {+(Identifier)+}
{+(TypeParameters)+})+} {+(TypeParameters)+})+}
{+(Constructor {+(Constructor
{+(Identifier)+} {+(Identifier)+}
{+(TypeParameters)+})+} {+(TypeParameters)+})+}
{+(Constructor (Constructor
{+(Identifier)+} { (Identifier)
{+(TypeParameters)+})+} ->(Identifier) }
{+(Constructor (TypeParameters))
{+(Identifier)+}
{+(TypeParameters)+})+}
{-(Constructor {-(Constructor
{-(Identifier)-} {-(Identifier)-}
{-(TypeParameters)-})-} {-(TypeParameters)-})-}
@ -78,13 +89,9 @@
{-(Constructor {-(Constructor
{-(Identifier)-} {-(Identifier)-}
{-(TypeParameters)-})-} {-(TypeParameters)-})-}
{-(Constructor (Empty))
{-(Identifier)-}
{-(TypeParameters)-})-}
{-(Constructor
{-(Identifier)-}
{-(TypeParameters)-})-})
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -96,8 +103,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -110,8 +119,10 @@
(Statements (Statements
(Identifier) (Identifier)
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -129,8 +140,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -151,8 +164,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
{-(Datatype {-(Datatype
{-(Empty)-}
{-(Type {-(Type
{-(Identifier)-} {-(Identifier)-}
{-(TypeParameters)-})-} {-(TypeParameters)-})-}
@ -169,8 +184,10 @@
{-(Field {-(Field
{-(Statements {-(Statements
{-(Identifier)-})-} {-(Identifier)-})-}
{-(Identifier)-})-})-})-})-} {-(Identifier)-})-})-})-}
{-(Empty)-})-}
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -187,8 +204,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
{+(Datatype {+(Datatype
{+(Empty)+}
{+(Type {+(Type
{+(Identifier)+} {+(Identifier)+}
{+(TypeParameters)+})+} {+(TypeParameters)+})+}
@ -205,4 +224,97 @@
{+(Field {+(Field
{+(Statements {+(Statements
{+(Identifier)+})+} {+(Identifier)+})+}
{+(Identifier)+})+})+})+})+})) {+(Identifier)+})+})+})+}
{+(Empty)+})+}
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters))
(Constructor
(Identifier)
(TypeParameters))
(Deriving
(Identifier)))
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters))
(Constructor
(Identifier)
(TypeParameters))
(Deriving
{ (Identifier)
->(Identifier) }
(Identifier)
(Identifier)
(Identifier)
(Identifier)
(Identifier)))
(Datatype
(Context'
(Class
{ (Identifier)
->(Identifier) }
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)))
(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)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Empty))
(Datatype
(Context'
(Class
(Identifier)
(TypeParameters
(TypeParameters
(Identifier)
(Identifier))))
(Class
{ (Identifier)
->(Identifier) }
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Empty))))

View File

@ -2,11 +2,14 @@
(Empty) (Empty)
(Statements (Statements
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
(TypeParameters))) (TypeParameters))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -16,8 +19,10 @@
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
(TypeParameters (TypeParameters
(Identifier)))) (Identifier)))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -28,8 +33,10 @@
->(Identifier) } ->(Identifier) }
(TypeParameters (TypeParameters
(StrictTypeVariable (StrictTypeVariable
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -42,8 +49,10 @@
(TypeParameters (TypeParameters
(StrictTypeVariable (StrictTypeVariable
(Identifier)) (Identifier))
(Identifier)))) (Identifier)))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -55,20 +64,19 @@
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
(TypeParameters)) (TypeParameters))
(Constructor
{ (Identifier)
->(Identifier) }
(TypeParameters))
{+(Constructor
{+(Identifier)+}
{+(TypeParameters)+})+}
{+(Constructor {+(Constructor
{+(Identifier)+} {+(Identifier)+}
{+(TypeParameters)+})+} {+(TypeParameters)+})+}
{+(Constructor {+(Constructor
{+(Identifier)+} {+(Identifier)+}
{+(TypeParameters)+})+} {+(TypeParameters)+})+}
(Constructor
{ (Identifier)
->(Identifier) }
(TypeParameters))
(Constructor
{ (Identifier)
->(Identifier) }
(TypeParameters))
{-(Constructor {-(Constructor
{-(Identifier)-} {-(Identifier)-}
{-(TypeParameters)-})-} {-(TypeParameters)-})-}
@ -77,8 +85,13 @@
{-(TypeParameters)-})-} {-(TypeParameters)-})-}
{-(Constructor {-(Constructor
{-(Identifier)-} {-(Identifier)-}
{-(TypeParameters)-})-}) {-(TypeParameters)-})-}
{-(Constructor
{-(Identifier)-}
{-(TypeParameters)-})-}
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -90,8 +103,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -104,8 +119,10 @@
(Statements (Statements
(Identifier) (Identifier)
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -123,8 +140,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
{ (Identifier) { (Identifier)
->(Identifier) } ->(Identifier) }
@ -145,8 +164,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
{+(Datatype {+(Datatype
{+(Empty)+}
{+(Type {+(Type
{+(Identifier)+} {+(Identifier)+}
{+(TypeParameters)+})+} {+(TypeParameters)+})+}
@ -163,8 +184,10 @@
{+(Field {+(Field
{+(Statements {+(Statements
{+(Identifier)+})+} {+(Identifier)+})+}
{+(Identifier)+})+})+})+})+} {+(Identifier)+})+})+})+}
{+(Empty)+})+}
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -181,8 +204,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
{-(Datatype {-(Datatype
{-(Empty)-}
{-(Type {-(Type
{-(Identifier)-} {-(Identifier)-}
{-(TypeParameters)-})-} {-(TypeParameters)-})-}
@ -199,4 +224,97 @@
{-(Field {-(Field
{-(Statements {-(Statements
{-(Identifier)-})-} {-(Identifier)-})-}
{-(Identifier)-})-})-})-})-})) {-(Identifier)-})-})-})-}
{-(Empty)-})-}
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters))
(Constructor
(Identifier)
(TypeParameters))
(Deriving
(Identifier)))
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters))
(Constructor
(Identifier)
(TypeParameters))
(Deriving
{ (Identifier)
->(Identifier) }
(Identifier)
(Identifier)
(Identifier)
(Identifier)
(Identifier)))
(Datatype
(Context'
(Class
{ (Identifier)
->(Identifier) }
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)))
(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)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Empty))
(Datatype
(Context'
(Class
(Identifier)
(TypeParameters
(TypeParameters
(Identifier)
(Identifier))))
(Class
{ (Identifier)
->(Identifier) }
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Empty))))

View File

@ -2,10 +2,13 @@
(Empty) (Empty)
(Statements (Statements
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters))) (TypeParameters))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters (TypeParameters
@ -13,8 +16,10 @@
(Constructor (Constructor
(Identifier) (Identifier)
(TypeParameters (TypeParameters
(Identifier)))) (Identifier)))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters (TypeParameters
@ -23,8 +28,10 @@
(Identifier) (Identifier)
(TypeParameters (TypeParameters
(StrictTypeVariable (StrictTypeVariable
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters (TypeParameters
@ -35,8 +42,10 @@
(TypeParameters (TypeParameters
(StrictTypeVariable (StrictTypeVariable
(Identifier)) (Identifier))
(Identifier)))) (Identifier)))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -57,8 +66,10 @@
(TypeParameters)) (TypeParameters))
(Constructor (Constructor
(Identifier) (Identifier)
(TypeParameters))) (TypeParameters))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -68,8 +79,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -80,8 +93,10 @@
(Statements (Statements
(Identifier) (Identifier)
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -97,8 +112,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -117,8 +134,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -135,8 +154,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -153,4 +174,93 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))))) (Identifier))))
(Empty))
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters))
(Constructor
(Identifier)
(TypeParameters))
(Deriving
(Identifier)))
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters))
(Constructor
(Identifier)
(TypeParameters))
(Deriving
(Identifier)
(Identifier)
(Identifier)
(Identifier)
(Identifier)
(Identifier)))
(Datatype
(Context'
(Class
(Identifier)
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)))
(Empty))
(Datatype
(Context'
(Class
(Identifier)
(TypeParameters
(Identifier)))
(Class
(Identifier)
(TypeParameters
(Identifier)))
(Class
(Identifier)
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Empty))
(Datatype
(Context'
(Class
(Identifier)
(TypeParameters
(TypeParameters
(Identifier)
(Identifier))))
(Class
(Identifier)
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Empty))))

View File

@ -2,10 +2,13 @@
(Empty) (Empty)
(Statements (Statements
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters))) (TypeParameters))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters (TypeParameters
@ -13,8 +16,10 @@
(Constructor (Constructor
(Identifier) (Identifier)
(TypeParameters (TypeParameters
(Identifier)))) (Identifier)))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters (TypeParameters
@ -23,8 +28,10 @@
(Identifier) (Identifier)
(TypeParameters (TypeParameters
(StrictTypeVariable (StrictTypeVariable
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters (TypeParameters
@ -35,8 +42,10 @@
(TypeParameters (TypeParameters
(StrictTypeVariable (StrictTypeVariable
(Identifier)) (Identifier))
(Identifier)))) (Identifier)))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -57,8 +66,10 @@
(TypeParameters)) (TypeParameters))
(Constructor (Constructor
(Identifier) (Identifier)
(TypeParameters))) (TypeParameters))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -68,8 +79,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -80,8 +93,10 @@
(Statements (Statements
(Identifier) (Identifier)
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -97,8 +112,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -117,8 +134,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -135,8 +154,10 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))) (Identifier))))
(Empty))
(Datatype (Datatype
(Empty)
(Type (Type
(Identifier) (Identifier)
(TypeParameters)) (TypeParameters))
@ -153,4 +174,93 @@
(Field (Field
(Statements (Statements
(Identifier)) (Identifier))
(Identifier))))))) (Identifier))))
(Empty))
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters))
(Constructor
(Identifier)
(TypeParameters))
(Deriving
(Identifier)))
(Datatype
(Empty)
(Type
(Identifier)
(TypeParameters))
(Constructor
(Identifier)
(TypeParameters))
(Deriving
(Identifier)
(Identifier)
(Identifier)
(Identifier)
(Identifier)
(Identifier)))
(Datatype
(Context'
(Class
(Identifier)
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)))
(Empty))
(Datatype
(Context'
(Class
(Identifier)
(TypeParameters
(Identifier)))
(Class
(Identifier)
(TypeParameters
(Identifier)))
(Class
(Identifier)
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Empty))
(Datatype
(Context'
(Class
(Identifier)
(TypeParameters
(TypeParameters
(Identifier)
(Identifier))))
(Class
(Identifier)
(TypeParameters
(Identifier))))
(Type
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Constructor
(Identifier)
(TypeParameters
(Identifier)
(Identifier)))
(Empty))))

View File

@ -1,11 +1,10 @@
(Module (Module
(Identifier) (Identifier)
(Statements (Statements
(Function {+(Function
{ (Identifier) {+(Identifier)+}
->(Identifier) } {+(Statements
(Statements {+(Integer)+})+})+}
(Integer)))
{+(Function {+(Function
{+(Identifier)+} {+(Identifier)+}
{+(Statements {+(Statements
@ -284,6 +283,10 @@
{-(Identifier)-} {-(Identifier)-}
{-(Statements {-(Statements
{-(Integer)-})-})-} {-(Integer)-})-})-}
{-(Function
{-(Identifier)-}
{-(Statements
{-(Integer)-})-})-}
{-(Function {-(Function
{-(Identifier)-} {-(Identifier)-}
{-(Statements {-(Statements

View File

@ -1,11 +1,10 @@
(Module (Module
(Identifier) (Identifier)
(Statements (Statements
(Function {+(Function
{ (Identifier) {+(Identifier)+}
->(Identifier) } {+(Statements
(Statements {+(Integer)+})+})+}
(Integer)))
{+(Function {+(Function
{+(Identifier)+} {+(Identifier)+}
{+(Statements {+(Statements
@ -54,12 +53,10 @@
{+(Identifier)+} {+(Identifier)+}
{+(Statements {+(Statements
{+(Float)+})+})+} {+(Float)+})+})+}
(Function {+(Function
{ (Identifier) {+(Identifier)+}
->(Identifier) } {+(Statements
(Statements {+(Float)+})+})+}
{+(Float)+}
{-(Integer)-}))
{+(Function {+(Function
{+(Identifier)+} {+(Identifier)+}
{+(Statements {+(Statements
@ -282,6 +279,14 @@
{-(Identifier)-} {-(Identifier)-}
{-(Statements {-(Statements
{-(Integer)-})-})-} {-(Integer)-})-})-}
{-(Function
{-(Identifier)-}
{-(Statements
{-(Integer)-})-})-}
{-(Function
{-(Identifier)-}
{-(Statements
{-(Integer)-})-})-}
{-(Function {-(Function
{-(Identifier)-} {-(Identifier)-}
{-(Statements {-(Statements