kure-2.18.6: Combinators for Strategic Programming
Copyright(c) 2012--2021 The University of Kansas
LicenseBSD3
MaintainerNeil Sculthorpe <neil.sculthorpe@ntu.ac.uk>
Stabilitybeta
Portabilityghc
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.KURE.ExtendableContext

Description

This module provides a utility data type for extending an existing context with extra information. The idea is that, after defining class instances for any user-specific contextual operations, it can be used for any ad-hoc context extensions. See the treatment of ExtendPath as an example.

Synopsis

Extending Contexts

data ExtendContext c e Source #

A context transformer, for augmenting a context with additional information.

Instances

Instances details
(ExtendPath c crumb, ExtendPath e crumb) => ExtendPath (ExtendContext c e) crumb Source #

Both components of the context are updated with the crumb.

Instance details

Defined in Language.KURE.ExtendableContext

Methods

(@@) :: ExtendContext c e -> crumb -> ExtendContext c e Source #

extendContext :: e -> c -> ExtendContext c e Source #

Extend a context with some additional information.

baseContext :: ExtendContext c e -> c Source #

Retrieve the base context (without the extra information).

extraContext :: ExtendContext c e -> e Source #

Retrieve the extra contextual information.