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

Safe HaskellSafe
LanguageHaskell98

DDC.Core.Transform.TransformUpX

Description

General purpose tree walking boilerplate.

Synopsis

Documentation

class TransformUpMX m c where Source #

Minimal complete definition

transformUpMX

Methods

transformUpMX :: Ord n => (EnvX n -> Exp a n -> m (Exp a n)) -> EnvX n -> c a n -> m (c a n) Source #

Bottom-up monadic rewrite of all core expressions in a thing.

Instances

Monad m => TransformUpMX m Alt Source # 

Methods

transformUpMX :: Ord n => (EnvX n -> Exp a n -> m (Exp a n)) -> EnvX n -> Alt a n -> m (Alt a n) Source #

Monad m => TransformUpMX m Lets Source # 

Methods

transformUpMX :: Ord n => (EnvX n -> Exp a n -> m (Exp a n)) -> EnvX n -> Lets a n -> m (Lets a n) Source #

Monad m => TransformUpMX m Exp Source # 

Methods

transformUpMX :: Ord n => (EnvX n -> Exp a n -> m (Exp a n)) -> EnvX n -> Exp a n -> m (Exp a n) Source #

Monad m => TransformUpMX m Module Source # 

Methods

transformUpMX :: Ord n => (EnvX n -> Exp a n -> m (Exp a n)) -> EnvX n -> Module a n -> m (Module a n) Source #

transformUpX Source #

Arguments

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

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

-> EnvX n

Initial environment.

-> c a n

Transform this thing.

-> c a n 

Bottom up rewrite of all core expressions in a thing.

transformUpX' Source #

Arguments

:: forall (c :: * -> * -> *). (Ord n, TransformUpMX 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 transformUpX, but without using environments.