| Safe Haskell | None | 
|---|---|
| Language | Haskell98 | 
Language.PureScript.Environment
- data Environment = Environment {
- names :: Map (ModuleName, 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)) ([(String, Maybe Kind)], [(Ident, Type)], [Constraint])
 
 - 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
 - tyObject :: 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)) ([(String, Maybe Kind)], [(Ident, Type)], [Constraint])
 - 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:
Constructors
| Environment | |
Fields 
  | |
Instances
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
Constructors
| 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
Instances
| Eq DataDeclType Source | |
| Ord DataDeclType Source | |
| Read DataDeclType Source | |
| Show DataDeclType Source | |
| FromJSON DataDeclType Source | |
| ToJSON DataDeclType Source | 
primName :: String -> Qualified (ProperName a) 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 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)) ([(String, Maybe Kind)], [(Ident, Type)], [Constraint]) 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.