Control-Monad-MultiPass-0.1.0.0: A Library for Writing Multi-Pass Algorithms.

Safe HaskellSafe

Control.Monad.MultiPass.Utils.UpdateCtx

Description

Utility functions for working with the UpdateThreadContext argument of createInstrument. This module is only relevant for Instrument authoring.

Synopsis

Documentation

updateCtxFst :: UpdateThreadContext rootTC (x, y) -> UpdateThreadContext rootTC xSource

If the thread context is a pair then updateCtxFst creates a new UpdateThreadContext function which can be used to update the first element of the pair.

updateCtxSnd :: UpdateThreadContext rootTC (x, y) -> UpdateThreadContext rootTC ySource

If the thread context is a pair then updateCtxSnd creates a new UpdateThreadContext function which can be used to update the second element of the pair.

updateCtxLeft :: UpdateThreadContext rootTC (Either x y) -> UpdateThreadContext rootTC xSource

If the thread context is an Either of two thread contexts then updateCtxLeft creates a new UpdateThreadContext function which can be used to update the Left element. This function will assert if the thread context is a Right element.

updateCtxRight :: UpdateThreadContext rootTC (Either x y) -> UpdateThreadContext rootTC ySource

If the thread context is an Either of two thread contexts then updateCtxRight creates a new UpdateThreadContext function which can be used to update the Right element. This function will assert if the thread context is a Left element.