Safe Haskell | None |
---|---|
Language | Haskell2010 |
IR.SubstMagic
Description
Substitute AST nodes with magical primitives.
Synopsis
- substMagic :: (Data t, Data a) => Proxy t -> a -> a
Documentation
substMagic :: (Data t, Data a) => Proxy t -> a -> a Source #
Substitute AST nodes with magical primitives.
Implemented as a syb-style generic tree traversal.
Example usage:
@@ -- Given: myExpr :: Expr Poly.Type
- - Do: substMagic (Proxy :: Proxy Poly.Type) myExpr
- - Given: myProm :: Program Annotated.Type
- - Do: substMagic (Proxy :: Proxy Annotated.Type) myProg @@