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, [Ident])
- typeSynonyms :: Map (Qualified ProperName) ([(String, Maybe Kind)], Type)
- typeClassDictionaries :: Map (Maybe ModuleName) (Map (Qualified ProperName) (Map (Qualified Ident) TypeClassDictionaryInScope))
- typeClasses :: Map (Qualified ProperName) ([(String, Maybe Kind)], [(Ident, Type)], [Constraint])
- initEnvironment :: Environment
- 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
- tyChar :: Type
- tyNumber :: Type
- tyInt :: Type
- tyBoolean :: Type
- tyArray :: Type
- tyObject :: Type
- isObject :: Type -> Bool
- isFunction :: Type -> Bool
- isTypeOrApplied :: Type -> Type -> Bool
- function :: Type -> Type -> Type
- primTypes :: Map (Qualified ProperName) (Kind, TypeKind)
- lookupConstructor :: Environment -> Qualified ProperName -> (DataDeclType, ProperName, Type, [Ident])
- isNewtypeConstructor :: Environment -> Qualified ProperName -> Bool
- lookupValue :: Environment -> Qualified Ident -> Maybe (Type, NameKind, NameVisibility)
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 NameVisibility Source
The visibility of a name in scope
A flag for whether a name is for an private or public value - only public values will be included in a generated externs file.
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
isFunction :: Type -> Bool Source
Check whether a type is a function
isTypeOrApplied :: Type -> Type -> Bool Source
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, [Ident]) 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.
lookupValue :: Environment -> Qualified Ident -> Maybe (Type, NameKind, NameVisibility) Source
Finds information about values from the current environment.