egison-5.0.0: Programming language with non-linear pattern-matching against non-free data
LicenseMIT
Safe HaskellNone
LanguageGHC2021

Language.Egison.Type.Subst

Description

This module provides type substitution operations for the type system.

Synopsis

Documentation

newtype Subst Source #

Type substitution: a mapping from type variables to types

Constructors

Subst 

Fields

Instances

Instances details
Generic Subst Source # 
Instance details

Defined in Language.Egison.Type.Subst

Associated Types

type Rep Subst 
Instance details

Defined in Language.Egison.Type.Subst

type Rep Subst = D1 ('MetaData "Subst" "Language.Egison.Type.Subst" "egison-5.0.0-IKLJXBVxR779jp4wYu1Icq" 'True) (C1 ('MetaCons "Subst" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSubst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map TyVar Type))))

Methods

from :: Subst -> Rep Subst x #

to :: Rep Subst x -> Subst #

Show Subst Source # 
Instance details

Defined in Language.Egison.Type.Subst

Methods

showsPrec :: Int -> Subst -> ShowS #

show :: Subst -> String #

showList :: [Subst] -> ShowS #

Eq Subst Source # 
Instance details

Defined in Language.Egison.Type.Subst

Methods

(==) :: Subst -> Subst -> Bool #

(/=) :: Subst -> Subst -> Bool #

type Rep Subst Source # 
Instance details

Defined in Language.Egison.Type.Subst

type Rep Subst = D1 ('MetaData "Subst" "Language.Egison.Type.Subst" "egison-5.0.0-IKLJXBVxR779jp4wYu1Icq" 'True) (C1 ('MetaCons "Subst" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSubst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map TyVar Type))))

emptySubst :: Subst Source #

Empty substitution

singletonSubst :: TyVar -> Type -> Subst Source #

Create a substitution with a single binding

composeSubst :: Subst -> Subst -> Subst Source #

Compose two substitutions (s2 after s1) (s2 composeSubst s1) x = s2 (s1 x)

applySubst :: Subst -> Type -> Type Source #

Apply a substitution to a type

applySubstScheme :: Subst -> TypeScheme -> TypeScheme Source #

Apply a substitution to a type scheme

applySubstConstraint :: Subst -> Constraint -> Constraint Source #

Apply a substitution to a constraint

data SubstIndex Source #

Index substitution: mapping from index variables to indices

Instances

Instances details
Generic SubstIndex Source # 
Instance details

Defined in Language.Egison.Type.Subst

Associated Types

type Rep SubstIndex 
Instance details

Defined in Language.Egison.Type.Subst

type Rep SubstIndex = D1 ('MetaData "SubstIndex" "Language.Egison.Type.Subst" "egison-5.0.0-IKLJXBVxR779jp4wYu1Icq" 'True) (C1 ('MetaCons "SubstIndex" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSubstIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map IndexTyVar Index))))
Show SubstIndex Source # 
Instance details

Defined in Language.Egison.Type.Subst

Eq SubstIndex Source # 
Instance details

Defined in Language.Egison.Type.Subst

type Rep SubstIndex Source # 
Instance details

Defined in Language.Egison.Type.Subst

type Rep SubstIndex = D1 ('MetaData "SubstIndex" "Language.Egison.Type.Subst" "egison-5.0.0-IKLJXBVxR779jp4wYu1Icq" 'True) (C1 ('MetaCons "SubstIndex" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSubstIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map IndexTyVar Index))))

emptySubstIndex :: SubstIndex Source #

Empty index substitution

singletonSubstIndex :: IndexTyVar -> Index -> SubstIndex Source #

Create an index substitution with a single binding

applySubstIndex :: SubstIndex -> IndexSpec -> IndexSpec Source #

Apply an index substitution to an index specification