Safe Haskell | None |
---|---|
Language | Haskell2010 |
IR.Constraint.Canonical
Synopsis
- data Type
- data Scheme = Forall FreeVars Type
- type FreeVars = Map TVarId ()
- data Annotation
- newtype Annotations = Annotations [Annotation]
- type Kind = Int
- schemeOf :: Type -> Scheme
- freeVars :: Type -> FreeVars
- foldArrow :: ([Type], Type) -> Type
- unfoldArrow :: Type -> ([Type], Type)
- (-->) :: Type -> Type -> Type
- pattern Unit :: Type
- pattern Ref :: Type -> Type
- pattern List :: Type -> Type
- pattern Time :: Type
- pattern I64 :: Type
- pattern U64 :: Type
- pattern I32 :: Type
- pattern U32 :: Type
- pattern I16 :: Type
- pattern U16 :: Type
- pattern I8 :: Type
- pattern U8 :: Type
- tuple :: [Type] -> Type
- unAnnotations :: Annotations -> [Annotation]
- annToType :: Annotation -> Type
- builtinKinds :: Map TConId Kind
Documentation
Encoding of sslang types.
Structurally speaking, these are very simple. Types are either type variables or type constructors applied to some other types.
Builtin types (and type constructors) include Arrow
, Unit
, Ref
, List
,
and various sizes of tuples; for convenience, those are defined elsewhere using
the GHC PatternSynonyms extension.
Constructors
TCon TConId [Type] | Type constructor, applied to zero or more types |
TVar TVarId | Type variable (may be implicitly quantified) |
Instances
Eq Type Source # | |
Data Type Source # | |
Defined in IR.Types.Type Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Type -> c Type # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Type # dataTypeOf :: Type -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Type) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type) # gmapT :: (forall b. Data b => b -> b) -> Type -> Type # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r # gmapQ :: (forall d. Data d => d -> u) -> Type -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Type -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Type -> m Type # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type # | |
Show Type Source # | |
Pretty Type Source # | |
Defined in IR.Types.Type | |
Dumpy Type Source # | |
HasType Type Source # | |
HasFreeVars Type TVarId Source # | |
Pretty (Alt Type) | |
Pretty (Expr Type) | |
Pretty (Program Type) | Pretty Typeclass: pretty print the IR Adds * indentation and line breaks * some parens (not minimal parens, but fewer than around every node) Omits * let _ = * type annotations Reverts * curried funcs of one arg back to multiple arg funcs |
data Annotation Source #
An annotation records the annotated portion of a pattern.
Constructors
AnnType Type | A basic |
AnnDCon DConId [Annotation] | Annotations collected from patterns |
AnnArrows [Annotation] Annotation | Annotations collected from fun args |
Instances
Eq Annotation Source # | |
Defined in IR.Types.Type | |
Data Annotation Source # | |
Defined in IR.Types.Type Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Annotation -> c Annotation # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Annotation # toConstr :: Annotation -> Constr # dataTypeOf :: Annotation -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Annotation) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Annotation) # gmapT :: (forall b. Data b => b -> b) -> Annotation -> Annotation # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Annotation -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Annotation -> r # gmapQ :: (forall d. Data d => d -> u) -> Annotation -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Annotation -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Annotation -> m Annotation # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Annotation -> m Annotation # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Annotation -> m Annotation # | |
Show Annotation Source # | |
Defined in IR.Types.Type Methods showsPrec :: Int -> Annotation -> ShowS # show :: Annotation -> String # showList :: [Annotation] -> ShowS # | |
Pretty Annotation Source # | |
Defined in IR.Types.Type | |
Dumpy Annotation Source # | |
Defined in IR.Types.Type Methods dumpy :: Annotation -> Doc ann Source # |
newtype Annotations Source #
Expressions are annotated with a (potentially empty) list of Annotation
.
Constructors
Annotations [Annotation] |
Instances
schemeOf :: Type -> Scheme Source #
Construct a scheme from all free type variables and a trivial constraint.
pattern List :: Type -> Type Source #
The builtin list Type
, created using list syntax, e.g., [a, b]
.
unAnnotations :: Annotations -> [Annotation] Source #
Unwrap the Annotations
data constructor.
annToType :: Annotation -> Type Source #
ANNOTATION