pire-0.2.5

Copyright(c) Andreas Reuleaux 2015 - 2018
LicenseBSD2
MaintainerAndreas Reuleaux <rx@a-rx.info>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Subst

Description

substitution on types

Documentation

type Subst t = Map (TVar t) (Type t) Source #

class Substitutable t a where Source #

Minimal complete definition

apply, ftv

Methods

apply :: Subst t -> a -> a Source #

ftv :: a -> Set (TVar t) Source #

Instances

Ord t => Substitutable t (Type t) Source # 

Methods

apply :: Subst t -> Type t -> Type t Source #

ftv :: Type t -> Set (TVar t) Source #

Ord t => Substitutable t (Scheme t) Source # 

Methods

apply :: Subst t -> Scheme t -> Scheme t Source #

ftv :: Scheme t -> Set (TVar t) Source #

Ord t => Substitutable t (Env b t) Source # 

Methods

apply :: Subst t -> Env b t -> Env b t Source #

ftv :: Env b t -> Set (TVar t) Source #

compose :: Ord t => Subst t -> Subst t -> Subst t Source #

bind :: (MonadError (TypeError t) m, Ord t) => TVar t -> Type t -> m (Subst t) Source #

occursCheck :: (Substitutable t a, Ord t) => TVar t -> a -> Bool Source #

occursIn :: Eq t => TVar t -> Type t -> Bool Source #