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

Safe HaskellSafe
LanguageHaskell98

DDC.Core.Transform.BoundT

Contents

Description

Lifting and lowering level-1 deBruijn indices in code things.

Level-1 indices are used for type variables.

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.

class MapBoundT c n where Source #

Minimal complete definition

mapBoundAtDepthT

Methods

mapBoundAtDepthT :: (Int -> Bound n -> Bound n) -> Int -> c n -> c n Source #

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.

Instances

Ord n => MapBoundT TypeSum n Source # 

Methods

mapBoundAtDepthT :: (Int -> Bound n -> Bound n) -> Int -> TypeSum n -> TypeSum n Source #

Ord n => MapBoundT Type n Source # 

Methods

mapBoundAtDepthT :: (Int -> Bound n -> Bound n) -> Int -> Type n -> Type n Source #

MapBoundT Bound n Source # 

Methods

mapBoundAtDepthT :: (Int -> Bound n -> Bound n) -> Int -> Bound n -> Bound n Source #

Ord n => MapBoundT Bind n Source # 

Methods

mapBoundAtDepthT :: (Int -> Bound n -> Bound n) -> Int -> Bind n -> Bind n Source #

Orphan instances

Ord n => MapBoundT (Witness a) n Source # 

Methods

mapBoundAtDepthT :: (Int -> Bound n -> Bound n) -> Int -> Witness a n -> Witness a n Source #

Ord n => MapBoundT (Cast a) n Source # 

Methods

mapBoundAtDepthT :: (Int -> Bound n -> Bound n) -> Int -> Cast a n -> Cast a n Source #

Ord n => MapBoundT (Alt a) n Source # 

Methods

mapBoundAtDepthT :: (Int -> Bound n -> Bound n) -> Int -> Alt a n -> Alt a n Source #

Ord n => MapBoundT (Exp a) n Source # 

Methods

mapBoundAtDepthT :: (Int -> Bound n -> Bound n) -> Int -> Exp a n -> Exp a n Source #