ddc-core-simpl-0.4.2.1: Disciplined Disciple Compiler code transformations.

Safe HaskellSafe
LanguageHaskell98

DDC.Core.Transform.TransformDownX

Description

General purpose tree walking boilerplate.

Synopsis

Documentation

class TransformDownMX m c where Source

Methods

transformDownMX Source

Arguments

:: Ord n 
=> (KindEnv n -> TypeEnv n -> Exp a n -> m (Exp a n))

The worker function is given the current kind and type environments.

-> KindEnv n

Initial kind environment.

-> TypeEnv n

Initial type environment.

-> c a n

Transform this thing.

-> m (c a n) 

Top-down monadic rewrite of all core expressions in a thing.

transformDownX Source

Arguments

:: forall (c :: * -> * -> *). (Ord n, TransformDownMX Identity c) 
=> (KindEnv n -> TypeEnv n -> Exp a n -> Exp a n)

The worker function is given the current kind and type environments.

-> KindEnv n

Initial kind environment.

-> TypeEnv n

Initial type environment.

-> c a n

Transform this thing.

-> c a n 

Top-down rewrite of all core expressions in a thing.

transformDownX' Source

Arguments

:: forall (c :: * -> * -> *). (Ord n, TransformDownMX Identity c) 
=> (Exp a n -> Exp a n)

The worker function is given the current kind and type environments.

-> c a n

Transform this thing.

-> c a n 

Like transformDownX, but without using environments.