| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Glam.Type
Description
The basic syntax and operations on types.
Synopsis
- type TVar = String
- type TSubst = Map TVar Type
- type Constancy = Bool
- data Guardedness
- data Type
- data Polytype = Forall [(TVar, Constancy)] Type
- pattern Monotype :: Type -> Polytype
- class HasTVars t where
- freeInType :: HasTVars t => TVar -> t -> Bool
- freshTVarsFor :: Set TVar -> [TVar]
- avoidCaptureType :: Set TVar -> (TVar, Type) -> (TVar, Type)
- substituteType :: TSubst -> Type -> Type
- substituteType1 :: TVar -> Type -> Type -> Type
- alphaNormalise :: Polytype -> Polytype
- prodPrec :: Num a => a
- sumPrec :: Num a => a
- funPrec :: Num a => a
- modPrec :: Num a => a
- appPrec :: Num a => a
- tVar :: Parser TVar
- tConstant :: ReaderT IndentRef (Parsec Void String) String
- type_ :: Parser Type
- quantifiedTVar :: Parser (TVar, Constancy)
- polytype :: Parser Polytype
Documentation
type Constancy = Bool Source #
Whether a type, or term, is constant. Note that False means "we don't know".
data Guardedness Source #
A fixed point variable can only be used when it is guarded by a ▸ modality.
Instances
| Eq Guardedness Source # | |
Defined in Glam.Type | |
Monomorphic types of the guarded λ-calculus
Constructors
| TVar TVar | Variables |
| TInt | Integers |
| TApp Type Type | Applications |
| One | |
| Type :*: Type infixr 7 | Products |
| Zero | |
| Type :+: Type infixr 6 | Sums |
| Type :->: Type infixr 5 | Functions |
| Later Type |
|
| Constant Type |
|
| TFix TVar Type | Fixed points |
Instances
| IsString Type Source # | |
Defined in Glam.Type Methods fromString :: String -> Type # | |
| Show Type Source # | |
| Eq Type Source # | |
| Constant Type Source # | A type is constant if all uses of |
Defined in Glam.Rules.Term Methods isConstant :: MonadCheckTerm m => Bool -> Type -> m Constancy Source # | |
| Types Type Source # | |
Defined in Glam.Rules.Term | |
| Zonk Type Source # | |
Defined in Glam.Rules.Term | |
| HasTVars Type Source # | |
Polymorphic type schemes
Instances
| Show Polytype Source # | |
| Eq Polytype Source # | |
| Constant Polytype Source # | |
Defined in Glam.Rules.Term Methods isConstant :: MonadCheckTerm m => Bool -> Polytype -> m Constancy Source # | |
| Types Polytype Source # | |
Defined in Glam.Rules.Term | |
| Zonk Polytype Source # | |
Defined in Glam.Rules.Term | |
| HasTVars Polytype Source # | |
Variables and substitution
alphaNormalise :: Polytype -> Polytype Source #