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

Safe HaskellSafe-Inferred

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 whereSource

Methods

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

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

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 nSource

Wrapper for substituteT to substitute multiple types.

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

Substitute a Type for a Bound in some thing.