Safe Haskell | None |
---|
Language.Nano.Typecheck.Types
Contents
Description
Global type definitions for Refinement Type Checker
- data Nano a t = Nano {}
- type NanoBare = Nano AnnBare Type
- type NanoSSA = Nano AnnSSA Type
- type NanoType = Nano AnnType Type
- newtype Source a = Src [FunctionStatement a]
- type FunctionStatement a = Statement a
- mapCode :: (a -> b) -> Nano a t -> Nano b t
- data RType r
- data Bind r = B {}
- toType :: RType a -> Type
- ofType :: Reftable r => Type -> RType r
- strengthen :: Reftable r => RType r -> r -> RType r
- bkFun :: RType r -> Maybe ([TVar], [Bind r], RType r)
- bkAll :: RType a -> ([TVar], RType a)
- type Type = RType ()
- data TVar = TV {}
- data TCon
- tInt :: Reftable r => RType r
- tBool :: Reftable r => RType r
- tVoid :: Reftable r => RType r
- tErr :: Reftable r => RType r
- tVar :: Reftable r => TVar -> RType r
- infixOpTy :: InfixOp -> Env t -> t
- prefixOpTy :: PrefixOp -> Env t -> t
- data Annot b a = Ann {}
- data Fact
- type AnnBare = Annot Fact SourcePos
- type AnnSSA = Annot Fact SourcePos
- type AnnType = Annot Fact SourcePos
- type AnnInfo = HashMap SourcePos [Fact]
Programs
Nano Program = Code + Types for all function binders
Constructors
Nano | |
type FunctionStatement a = Statement aSource
(Refinement) Types
(Raw) Refined Types
Instances
Functor RType | |
RefTypable Type | |
RefTypable RefType | |
Inputable Type | |
Inputable RefType | |
(PP r, Reftable r) => Substitutable r (RType r) | |
Eq r => Eq (RType r) | |
Ord r => Ord (RType r) | |
Show r => Show (RType r) | |
Reftable r => PP (RType r) | |
(Reftable r, Subable r) => Subable (RType r) | Substitutions ----------------------------------------------------------------------- |
Free (RType r) |
strengthen :: Reftable r => RType r -> r -> RType rSource
Deconstructing Types
Regular Types
Type Variables
Constructed Type Bodies data TBody r = TD { td_con :: !TCon , td_args :: ![TVar] , td_body :: !(RType r) , td_pos :: !SourcePos } deriving (Show, Functor)
Type Constructors
Primitive Types
tVar :: Reftable r => TVar -> RType rSource
Primitive / Base Types -------------------------------------------
Operator Types
infixOpTy :: InfixOp -> Env t -> tSource
Operator Types ---------------------------------------------------
prefixOpTy :: PrefixOp -> Env t -> tSource
Annotations
Annotations ------------------------------------------------------------
Annotations: Extra-code decorations needed for Refinement Type Checking
Ideally, we'd have room for these inside the Statement
and
Expression
type, but are tucking them in using the a
parameter.