ddc-core-0.4.3.1: Disciplined Disciple Compiler core language and type checker.

Safe HaskellSafe
LanguageHaskell98

DDC.Core.Transform.SubstituteTX

Description

Capture avoiding substitution of types in expressions.

If a binder would capture a variable then it is anonymized to deBruijn form.

Synopsis

Documentation

class SubstituteTX c where Source #

Minimal complete definition

substituteWithTX

Methods

substituteWithTX :: forall n. Ord n => Type n -> Sub n -> c n -> c n Source #

Instances

SubstituteTX Type Source # 

Methods

substituteWithTX :: Ord n => Type n -> Sub n -> Type n -> Type n Source #

SubstituteTX Bind Source # 

Methods

substituteWithTX :: Ord n => Type n -> Sub n -> Bind n -> Bind n Source #

SubstituteTX (Witness a) Source # 

Methods

substituteWithTX :: Ord n => Type n -> Sub n -> Witness a n -> Witness a n Source #

SubstituteTX (Cast a) Source # 

Methods

substituteWithTX :: Ord n => Type n -> Sub n -> Cast a n -> Cast a n Source #

SubstituteTX (Alt a) Source # 

Methods

substituteWithTX :: Ord n => Type n -> Sub n -> Alt a n -> Alt a n Source #

SubstituteTX (Exp a) Source # 

Methods

substituteWithTX :: Ord n => Type n -> Sub n -> Exp a n -> Exp a n Source #

substituteTX :: (SubstituteTX c, Ord n) => Bind n -> Type n -> c n -> c n Source #

Substitute a Type for the Bound corresponding to some Bind in a thing.

substituteTXs :: (SubstituteTX c, Ord n) => [(Bind n, Type n)] -> c n -> c n Source #

Wrapper for substituteT to substitute multiple types.

substituteBoundTX :: (SubstituteTX c, Ord n) => Bound n -> Type n -> c n -> c n Source #

Substitute a Type for a Bound in some thing.