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

Safe HaskellSafe
LanguageHaskell98

DDC.Type.Transform.BoundT

Description

Lifting and lowering of deBruijn indices in types.

Synopsis

Documentation

liftT :: MapBoundT c n => Int -> c n -> c n Source

Wrapper for liftAtDepthX that starts at depth 0.

liftAtDepthT Source

Arguments

:: MapBoundT c n 
=> Int

Number of levels to lift.

-> Int

Current binding depth.

-> c n

Lift expression indices in this thing.

-> c n 

Lift debruijn indices less than or equal to the given depth.

lowerT :: MapBoundT c n => Int -> c n -> c n Source

Wrapper for lowerAtDepthX that starts at depth 0.

lowerAtDepthT Source

Arguments

:: MapBoundT c n 
=> Int

Number of levels to lower.

-> Int

Current binding depth.

-> c n

Lower expression indices in this thing.

-> c n 

Lower debruijn indices less than or equal to the given depth.

class MapBoundT c n where Source

Methods

mapBoundAtDepthT Source

Arguments

:: (Int -> Bound n -> Bound n)

Function to apply to the bound occ. It is passed the current binding depth.

-> Int

Current binding depth.

-> c n

Lift expression indices in this thing.

-> c n 

Apply a function to all bound variables in the program. The function is passed the current binding depth. This is used to defined both liftT and lowerT.