ddc-core-flow-0.4.3.1: Disciplined Disciple Compiler data flow compiler.

Safe HaskellSafe
LanguageHaskell98

DDC.Core.Flow.Transform.TransformUpX

Contents

Description

General purpose tree walking boilerplate.

Synopsis

Documentation

class TransformUpMX m c where #

Instances

Monad m => TransformUpMX m Module 

Methods

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

Monad m => TransformUpMX m Lets 

Methods

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

Monad m => TransformUpMX m Exp 

Methods

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

Monad m => TransformUpMX m Alt 

Methods

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

transformUpX #

Arguments

:: (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' #

Arguments

:: (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.

Via the Simple AST

transformSimpleUpMX Source #

Arguments

:: (Ord n, TransformUpMX m c, Monad m) 
=> (EnvX n -> Exp a n -> m (Maybe (Exp a n)))

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

-> EnvX n

Initial type environment.

-> c a n

Transform thing thing.

-> m (c a n) 

Like transformUpMX, but the worker takes the Simple version of the AST.

  • To avoid repeated conversions between the different versions of the AST, the worker should return Nothing if the provided expression is unchanged.

transformSimpleUpX Source #

Arguments

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

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

-> EnvX n

Initial type environment.

-> c a n

Transform this thing.

-> c a n 

Like transformUpX, but the worker takes the Simple version of the AST.

  • To avoid repeated conversions between the different versions of the AST, the worker should return Nothing if the provided expression is unchanged.

transformSimpleUpX' Source #

Arguments

:: forall (c :: * -> * -> *). (Ord n, TransformUpMX Identity c) 
=> (Exp a n -> Maybe (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 the worker takes the Simple version of the AST.

  • To avoid repeated conversions between the different versions of the AST, the worker should return Nothing if the provided expression is unchanged.