Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Environment = Environment {
- names :: Map (Qualified Ident) (Type, NameKind, NameVisibility)
- types :: Map (Qualified (ProperName TypeName)) (Kind, TypeKind)
- dataConstructors :: Map (Qualified (ProperName ConstructorName)) (DataDeclType, ProperName TypeName, Type, [Ident])
- typeSynonyms :: Map (Qualified (ProperName TypeName)) ([(String, Maybe Kind)], Type)
- typeClassDictionaries :: Map (Maybe ModuleName) (Map (Qualified (ProperName ClassName)) (Map (Qualified Ident) TypeClassDictionaryInScope))
- typeClasses :: Map (Qualified (ProperName ClassName)) TypeClassData
- data TypeClassData = TypeClassData {
- typeClassArguments :: [(String, Maybe Kind)]
- typeClassMembers :: [(Ident, Type)]
- typeClassSuperclasses :: [Constraint]
- typeClassDependencies :: [FunctionalDependency]
- data FunctionalDependency = FunctionalDependency {
- fdDeterminers :: [Int]
- fdDetermined :: [Int]
- initEnvironment :: Environment
- data NameVisibility
- data NameKind
- data TypeKind
- = DataType [(String, Maybe Kind)] [(ProperName ConstructorName, [Type])]
- | TypeSynonym
- | ExternData
- | LocalTypeVariable
- | ScopedTypeVar
- data DataDeclType
- showDataDeclType :: DataDeclType -> String
- primName :: String -> Qualified (ProperName a)
- primTy :: String -> Type
- tyFunction :: Type
- tyString :: Type
- tyChar :: Type
- tyNumber :: Type
- tyInt :: Type
- tyBoolean :: Type
- tyArray :: Type
- tyRecord :: Type
- isObject :: Type -> Bool
- isFunction :: Type -> Bool
- isTypeOrApplied :: Type -> Type -> Bool
- function :: Type -> Type -> Type
- primTypes :: Map (Qualified (ProperName TypeName)) (Kind, TypeKind)
- primClasses :: Map (Qualified (ProperName ClassName)) TypeClassData
- lookupConstructor :: Environment -> Qualified (ProperName ConstructorName) -> (DataDeclType, ProperName TypeName, Type, [Ident])
- isNewtypeConstructor :: Environment -> Qualified (ProperName ConstructorName) -> 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 | |
|
data TypeClassData Source #
Information about a type class
TypeClassData | |
|
data FunctionalDependency Source #
A functional dependency indicates a relationship between two sets of type arguments in a class declaration.
FunctionalDependency | |
|
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 ConstructorName, [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
tyFunction :: Type Source #
Type constructor for functions
isFunction :: Type -> Bool Source #
Check whether a type is a function
primTypes :: Map (Qualified (ProperName TypeName)) (Kind, TypeKind) Source #
The primitive types in the external javascript environment with their
associated kinds. There is also a pseudo Partial
type that corresponds to
the class with the same name.
primClasses :: Map (Qualified (ProperName ClassName)) TypeClassData Source #
The primitive class map. This just contains to Partial
class, used as a
kind of magic constraint for partial functions.
lookupConstructor :: Environment -> Qualified (ProperName ConstructorName) -> (DataDeclType, ProperName TypeName, Type, [Ident]) Source #
Finds information about data constructors from the current environment.
isNewtypeConstructor :: Environment -> Qualified (ProperName ConstructorName) -> 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.