retrie-1.2.1: A powerful, easy-to-use codemodding tool for Haskell.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Retrie.Context

Synopsis

Documentation

type ContextUpdater = forall m. MonadIO m => GenericCU (TransformT m) Context Source #

Type of context update functions for apply. When defining your own ContextUpdater, you probably want to extend updateContext using SYB combinators such as mkQ and extQ.

updateContext :: forall m. MonadIO m => GenericCU (TransformT m) Context Source #

Default context update function.

emptyContext :: FixityEnv -> Rewriter -> Rewriter -> Context Source #

Create an empty Context with given FixityEnv, rewriter, and dependent rewrite generator.

addInScope :: Context -> [RdrName] -> Context Source #

Add set of binders to ctxtInScope.

addBinders :: Context -> [RdrName] -> Context Source #

Add set of binders to ctxtBinders.

updateSubstitution :: Context -> [RdrName] -> (Context, [RdrName]) Source #

Update the Context's substitution appropriately for a set of binders. Returns a new Context and a potentially alpha-renamed set of binders.

updateBinder :: FreeVars -> RdrName -> Either RdrName (RdrName, RdrName) Source #

Check if RdrName is in FreeVars.

If so, return a pair of it and its new name (Right). If not, return it unchanged (Left).