| Safe Haskell | Safe-Inferred |
|---|
DDC.Core.Transform.TransformUpX
Contents
Description
General purpose tree walking boilerplate.
- class TransformUpMX m c where
- transformUpX :: forall c a n. (Ord n, TransformUpMX Identity c) => (KindEnv n -> TypeEnv n -> Exp a n -> Exp a n) -> KindEnv n -> TypeEnv n -> c a n -> c a n
- transformUpX' :: forall c a n. (Ord n, TransformUpMX Identity c) => (Exp a n -> Exp a n) -> c a n -> c a n
- transformSimpleUpMX :: (Ord n, TransformUpMX m c, Monad m) => (KindEnv n -> TypeEnv n -> Exp a n -> m (Maybe (Exp a n))) -> KindEnv n -> TypeEnv n -> c a n -> m (c a n)
- transformSimpleUpX :: forall c a n. (Ord n, TransformUpMX Identity c) => (KindEnv n -> TypeEnv n -> Exp a n -> Maybe (Exp a n)) -> KindEnv n -> TypeEnv n -> c a n -> c a n
- transformSimpleUpX' :: forall c a n. (Ord n, TransformUpMX Identity c) => (Exp a n -> Maybe (Exp a n)) -> c a n -> c a n
Documentation
class TransformUpMX m c whereSource
Methods
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) |
Bottom-up monadic rewrite of all core expressions in a thing.
Instances
| Monad m => TransformUpMX m Alt | |
| Monad m => TransformUpMX m Lets | |
| Monad m => TransformUpMX m Exp | |
| Monad m => TransformUpMX m Module |
Arguments
| :: forall c a n . (Ord n, TransformUpMX 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 |
Bottom up rewrite of all core expressions in a thing.
Arguments
| :: forall c a n . (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) | |
| => (KindEnv n -> TypeEnv n -> Exp a n -> m (Maybe (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 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
Nothingif the provided expression is unchanged.
Arguments
| :: forall c a n . (Ord n, TransformUpMX Identity c) | |
| => (KindEnv n -> TypeEnv n -> Exp a n -> Maybe (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 |
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
Nothingif the provided expression is unchanged.
Arguments
| :: forall c a n . (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
Nothingif the provided expression is unchanged.