Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Environment = Environment {
- names :: Map (ModuleName, Ident) (Type, NameKind, NameVisibility)
- types :: Map (Qualified ProperName) (Kind, TypeKind)
- dataConstructors :: Map (Qualified ProperName) (DataDeclType, ProperName, Type)
- typeSynonyms :: Map (Qualified ProperName) ([(String, Maybe Kind)], Type)
- typeClassDictionaries :: Map (Qualified Ident, Maybe ModuleName) TypeClassDictionaryInScope
- typeClasses :: Map (Qualified ProperName) ([(String, Maybe Kind)], [(Ident, Type)], [Constraint])
- initEnvironment :: Environment
- data ForeignImportType
- data NameVisibility
- data NameKind
- data TypeKind
- = DataType [(String, Maybe Kind)] [(ProperName, [Type])]
- | TypeSynonym
- | ExternData
- | LocalTypeVariable
- | ScopedTypeVar
- data DataDeclType
- primName :: String -> Qualified ProperName
- primTy :: String -> Type
- tyFunction :: Type
- tyString :: Type
- tyNumber :: Type
- tyBoolean :: Type
- tyArray :: Type
- tyObject :: Type
- function :: Type -> Type -> Type
- primTypes :: Map (Qualified ProperName) (Kind, TypeKind)
- lookupConstructor :: Environment -> Qualified ProperName -> (DataDeclType, ProperName, Type)
- isNewtypeConstructor :: Environment -> Qualified ProperName -> Bool
Documentation
data Environment Source
The Environment
defines all values and types which are currently in scope:
Environment | |
|
initEnvironment :: Environment Source
The initial environment with no values and only the default javascript types defined
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 |
data NameVisibility Source
The visibility of a name in scope
The kind of a name
Value | A value introduced as a binding in a module |
TypeClassAccessorImport | A type class dictionary member accessor import, generated during desugaring of type class declarations |
Extern ForeignImportType | A foreign import |
LocalVariable | A local name introduced using a lambda abstraction, variable introduction or binder |
DataConstructor | A data constructor |
TypeInstanceDictionaryValue | A type class dictionary, generated during desugaring of type class declarations |
The kinds of a type
DataType [(String, Maybe Kind)] [(ProperName, [Type])] | Data type |
TypeSynonym | Type synonym |
ExternData | Foreign data |
LocalTypeVariable | A local type variable |
ScopedTypeVar | A scoped type variable |
data DataDeclType Source
The type ('data' or 'newtype') of a data type declaration
primName :: String -> Qualified ProperName Source
Construct a ProperName in the Prim module
tyFunction :: Type Source
Type constructor for functions
primTypes :: Map (Qualified ProperName) (Kind, TypeKind) Source
The primitive types in the external javascript environment with their associated kinds.
lookupConstructor :: Environment -> Qualified ProperName -> (DataDeclType, ProperName, Type) Source
Finds information about data constructors from the current environment.
isNewtypeConstructor :: Environment -> Qualified ProperName -> Bool Source
Checks whether a data constructor is for a newtype.