Safe Haskell | None |
---|
Smart constructor and destructor functions for CoreHW
- type Gamma = HashMap TmName Type
- type Delta = HashMap TyName Kind
- termType :: (Functor m, Fresh m) => Term -> m Type
- collectArgs :: Term -> (Term, [Either Term Type])
- collectBndrs :: Fresh m => Term -> m ([Either Id TyVar], Term)
- applyTypeToArgs :: Fresh m => Type -> [Either Term Type] -> m Type
- patIds :: Pat -> [Id]
- mkTyVar :: Kind -> TyName -> TyVar
- mkId :: Type -> TmName -> Id
- mkAbstraction :: Term -> [Either Id TyVar] -> Term
- mkTyLams :: Term -> [TyVar] -> Term
- mkLams :: Term -> [Id] -> Term
- mkApps :: Term -> [Either Term Type] -> Term
- mkTmApps :: Term -> [Term] -> Term
- mkTyApps :: Term -> [Type] -> Term
- isFun :: (Functor m, Fresh m) => Term -> m Bool
- isLam :: Term -> Bool
- isLet :: Term -> Bool
- isVar :: Term -> Bool
- isCon :: Term -> Bool
- isPrim :: Term -> Bool
- idToVar :: Id -> Term
- varToId :: Term -> Id
Documentation
collectArgs :: Term -> (Term, [Either Term Type])Source
Split a (Type)Application in the applied term and it arguments
collectBndrs :: Fresh m => Term -> m ([Either Id TyVar], Term)Source
Split a (Type)Abstraction in the bound variables and the abstracted term
applyTypeToArgs :: Fresh m => Type -> [Either Term Type] -> m TypeSource
Get the result type of a polymorphic function given a list of arguments