sslang-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

IR.SubstMagic

Description

Substitute AST nodes with magical primitives.

Synopsis

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 @@