ddc-core-0.4.2.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

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.