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

Safe HaskellSafe-Inferred

DDC.Core.Transform.SubstituteWX

Description

Capture avoiding substitution of witnesses in expressions.

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

Synopsis

Documentation

class SubstituteWX c whereSource

Methods

substituteWithWX :: forall a n. Ord n => Witness a n -> Sub n -> c a n -> c a nSource

substituteWX :: (Ord n, SubstituteWX c) => Bind n -> Witness a n -> c a n -> c a nSource

Wrapper for substituteWithWX that determines the set of free names in the type being substituted, and starts with an empty binder stack.

substituteWXs :: (Ord n, SubstituteWX c) => [(Bind n, Witness a n)] -> c a n -> c a nSource

Wrapper for substituteWithWX to substitute multiple things.