- class Term exp where
- class (Monoid dec, Monad m, Term exp) => Walker m dec exp where
- extractR :: (Monad m, Term exp, Monoid dec) => Rewrite m dec (Generic exp) -> Rewrite m dec exp
- promoteR :: (Monad m, Term exp, Monoid dec) => Rewrite m dec exp -> Rewrite m dec (Generic exp)
- extractU :: (Monad m, Term exp, Monoid dec) => Translate m dec (Generic exp) r -> Translate m dec exp r
- topdownR :: (e ~ Generic e, Walker m dec e) => Rewrite m dec e -> Rewrite m dec e
- bottomupR :: (e ~ Generic e, Walker m dec e) => Rewrite m dec e -> Rewrite m dec e
- alltdR :: (e ~ Generic e, Walker m dec e) => Rewrite m dec e -> Rewrite m dec e
- downupR :: (e ~ Generic e, Walker m dec e) => Rewrite m dec e -> Rewrite m dec e
- innermostR :: (e ~ Generic e, Walker m dec e) => Rewrite m dec e -> Rewrite m dec e
- foldU :: (e ~ Generic e, Walker m dec e, Monoid r) => Translate m dec e r -> Translate m dec e r

# Documentation

`Term`

s are things that syntax are built from.

`Generic`

is a sum of all the interesting sub-types, transitively, of `exp`

.
We use `Generic e ~ e`

to signify that something is its own Generic.
Simple expression types might be their own sole `Generic`

, more complex examples
will have a new datatype for the `Generic`

, which will also be an instance of class `Term`

.

class (Monoid dec, Monad m, Term exp) => Walker m dec exp whereSource

`Walker`

captures how we walk over `exp`

, using a specific `m`

and `dec`

.

extractR :: (Monad m, Term exp, Monoid dec) => Rewrite m dec (Generic exp) -> Rewrite m dec expSource

promoteR :: (Monad m, Term exp, Monoid dec) => Rewrite m dec exp -> Rewrite m dec (Generic exp)Source