Expand description
Traits for transforming bits of IR.
Re-exports§
pub use self::shift::Shift;
Modules§
- Shifting of debruijn indices
Structs§
- Substitution used during folding
Traits§
- A “folder” is a transformer that can be used to make a copy of some term – that is, some bit of IR, such as a
Goal
– with certain changes applied. The idea is that it contains methods that let you swap types/lifetimes for new types/lifetimes; meanwhile, each bit of IR implements theTypeFoldable
trait which, given aFallibleTypeFolder
, will reconstruct itself, invoking the folder’s methods to transform each of the types/lifetimes embedded within. - Applies the given
TypeFolder
to a value, producing a folded result of typeSelf::Result
. The result type is typically the same as the source type, but in some cases we convert from borrowed to owned as well (e.g., the folder for&T
will fold to a freshT
; well, actuallyT::Result
). - A “folder” is a transformer that can be used to make a copy of some term – that is, some bit of IR, such as a
Goal
– with certain changes applied. The idea is that it contains methods that let you swap types/lifetimes for new types/lifetimes; meanwhile, each bit of IR implements theTypeFoldable
trait which, given aTypeFolder
, will reconstruct itself, invoking the folder’s methods to transform each of the types/lifetimes embedded within. - For types where “fold” invokes a callback on the
TypeFolder
, theTypeSuperFoldable
trait captures the recursive behavior that folds all the contents of the type.