Module FlatCurry.Transform.Utils

Author
Michael Hanus, Steven Libby
Version
September 2025

Utility operations to execute program transformations.

Exported Datatypes:
Exported Functions:

Exported Datatypes


newtype ReWriter a

Constructor:

ReWriter :: (VarIndex -> (a, [Step], VarIndex, Bool)) -> ReWriter a

Fields:

Known instances:


Exported Functions


replace :: Expr -> [Int] -> Expr -> Expr  Deterministic 

Replace a subexpression in an expressions, i.e., replace e p w implements e[w]_p.

Further infos:
  • partially defined

newVar :: Expr -> Int  Deterministic 

Returns the next unused variable index in an expression.


curVar :: ReWriter Int  Deterministic 


update :: a -> (String, [Int], Expr) -> Int -> ReWriter a  Deterministic