Copyright | (c) 2013-2015 Galois, Inc. |
---|---|
License | BSD3 |
Maintainer | cryptol@galois.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
- data Subst = S {}
- emptySubst :: Subst
- singleSubst :: TVar -> Type -> Subst
- (@@) :: Subst -> Subst -> Subst
- defaultingSubst :: Subst -> Subst
- listSubst :: [(TVar, Type)] -> Subst
- isEmptySubst :: Subst -> Bool
- substToList :: Subst -> Maybe [(TVar, Type)]
- class FVS t where
- class TVars t where
- defaultFreeVar :: TVar -> Type
- apSubstTypeMapKeys :: Subst -> TypeMap a -> TypeMap a
Documentation
singleSubst :: TVar -> Type -> Subst Source
defaultingSubst :: Subst -> Subst Source
listSubst :: [(TVar, Type)] -> Subst Source
Makes a substitution out of a list. WARNING: We do not validate the list in any way, so the caller should ensure that we end up with a valid (e.g., idempotent) substitution.
isEmptySubst :: Subst -> Bool Source
TVars Decl | |
TVars DeclGroup | |
TVars Match | |
TVars Expr | |
TVars Type | |
TVars Schema | WARNING: This instance assumes that the quantified variables in the types in the substitution will not get captured by the quantified variables. This is reasonable because there should be no shadowing of quantified variables but, just in case, we make a sanity check and panic if somehow capture did occur. |
TVars Module | |
TVars ConstraintSource | |
TVars Error | |
TVars Warning | |
TVars DelayedCt | |
TVars HasGoal | |
TVars Goal | |
TVars Goals | |
TVars t => TVars [t] | |
TVars t => TVars (Maybe t) | |
TVars a => TVars (TypeMap a) | |
(TVars s, TVars t) => TVars (s, t) | |
(Functor m, TVars a) => TVars (List m a) |
defaultFreeVar :: TVar -> Type Source
Pick types for unconstrained unification variables.
apSubstTypeMapKeys :: Subst -> TypeMap a -> TypeMap a Source
Apply the substitution to the keys of a type map.