Safe Haskell | None |
---|
Data types for modules and declarations
- type Precedence = Integer
- data Associativity
- data Fixity = Fixity Associativity Precedence
- data Module = Module ProperName [Declaration]
- data ForeignImportType
- data Declaration
- = DataDeclaration ProperName [String] [(ProperName, Maybe Type)]
- | DataBindingGroupDeclaration [Declaration]
- | TypeSynonymDeclaration ProperName [String] Type
- | TypeDeclaration Ident Type
- | ValueDeclaration Ident [Binder] (Maybe Guard) Value
- | BindingGroupDeclaration [(Ident, Value)]
- | ExternDeclaration ForeignImportType Ident (Maybe JS) Type
- | ExternDataDeclaration ProperName Kind
- | FixityDeclaration Fixity String
- | ImportDeclaration ModuleName (Maybe [Either Ident ProperName])
- | TypeClassDeclaration ProperName String [Declaration]
- | TypeInstanceDeclaration [(Qualified ProperName, Type)] (Qualified ProperName) Type [Declaration]
- isValueDecl :: Declaration -> Bool
- isDataDecl :: Declaration -> Bool
- isImportDecl :: Declaration -> Bool
- isExternDataDecl :: Declaration -> Bool
- isFixityDecl :: Declaration -> Bool
- isExternDecl :: Declaration -> Bool
- isTypeClassDeclaration :: Declaration -> Bool
Documentation
type Precedence = IntegerSource
A precedence level for an infix operator
data Associativity Source
Associativity for infix operators
Fixity data for infix operators
A module declaration, consisting of a module name and a list of declarations
data ForeignImportType Source
The type of a foreign import
ForeignImport | A regular foreign import |
InlineJavascript | A foreign import which contains inline Javascript as a string literal |
TypeClassDictionaryImport | A type class dictionary import, generated during desugaring of type class declarations |
TypeClassAccessorImport | A type class dictionary member accessor import, generated during desugaring of type class declarations |
data Declaration Source
The data type of declarations
DataDeclaration ProperName [String] [(ProperName, Maybe Type)] | A data type declaration (name, arguments, data constructors) |
DataBindingGroupDeclaration [Declaration] | A minimal mutually recursive set of data type declarations |
TypeSynonymDeclaration ProperName [String] Type | A type synonym declaration (name, arguments, type) |
TypeDeclaration Ident Type | A type declaration for a value (name, ty) |
ValueDeclaration Ident [Binder] (Maybe Guard) Value | A value declaration (name, top-level binders, optional guard, value) |
BindingGroupDeclaration [(Ident, Value)] | A minimal mutually recursive set of value declarations |
ExternDeclaration ForeignImportType Ident (Maybe JS) Type | A foreign import declaration (type, name, optional inline Javascript, type) |
ExternDataDeclaration ProperName Kind | A data type foreign import (name, kind) |
FixityDeclaration Fixity String | A fixity declaration (fixity data, operator name) |
ImportDeclaration ModuleName (Maybe [Either Ident ProperName]) | A module import (module name, optional set of identifiers to import) |
TypeClassDeclaration ProperName String [Declaration] | A type class declaration (name, argument, member declarations) |
TypeInstanceDeclaration [(Qualified ProperName, Type)] (Qualified ProperName) Type [Declaration] | A type instance declaration (dependencies, class name, instance type, member declarations) |
isValueDecl :: Declaration -> BoolSource
Test if a declaration is a value declaration
isDataDecl :: Declaration -> BoolSource
Test if a declaration is a data type or type synonym declaration
isImportDecl :: Declaration -> BoolSource
Test if a declaration is a module import
isExternDataDecl :: Declaration -> BoolSource
Test if a declaration is a data type foreign import
isFixityDecl :: Declaration -> BoolSource
Test if a declaration is a fixity declaration
isExternDecl :: Declaration -> BoolSource
Test if a declaration is a foreign import
isTypeClassDeclaration :: Declaration -> BoolSource
Test if a declaration is a type class or instance declaration