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

DDC.Core.Flow.Transform.TransformUpX

Contents

Description

General purpose tree walking boilerplate.

Synopsis

# Documentation

class TransformUpMX m c where #

Instances

 MethodstransformUpMX :: Ord n => (EnvX n -> Exp a n -> m (Exp a n)) -> EnvX n -> Module a n -> m (Module a n) # MethodstransformUpMX :: Ord n => (EnvX n -> Exp a n -> m (Exp a n)) -> EnvX n -> Lets a n -> m (Lets a n) # MethodstransformUpMX :: Ord n => (EnvX n -> Exp a n -> m (Exp a n)) -> EnvX n -> Exp a n -> m (Exp a n) # MethodstransformUpMX :: Ord n => (EnvX n -> Exp a n -> m (Exp a n)) -> EnvX n -> Alt a n -> m (Alt a n) #

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.

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

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.

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.

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.