Safe Haskell | Safe |
---|---|
Language | Haskell98 |
General purpose tree walking boilerplate.
- class TransformUpMX m c where
- transformUpX :: (Ord n, TransformUpMX Identity c) => (EnvX n -> Exp a n -> Exp a n) -> EnvX n -> c a n -> c a n
- transformUpX' :: (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) => (EnvX n -> Exp a n -> m (Maybe (Exp a n))) -> EnvX n -> c a n -> m (c a n)
- transformSimpleUpX :: forall c a n. (Ord n, TransformUpMX Identity c) => (EnvX n -> Exp a n -> Maybe (Exp a n)) -> EnvX 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 where #
Monad m => TransformUpMX m Module | |
Monad m => TransformUpMX m Lets | |
Monad m => TransformUpMX m Exp | |
Monad m => TransformUpMX m Alt | |
:: (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.
:: (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
:: (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.
:: 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.
:: 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.