Portability | ghc |
---|---|
Stability | beta |
Maintainer | Neil Sculthorpe <neil@ittc.ku.edu> |
Safe Haskell | Safe-Inferred |
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.
- data ExtendContext c e
- extendContext :: e -> c -> ExtendContext c e
- baseContext :: ExtendContext c e -> c
- extraContext :: ExtendContext c e -> e
Extending Contexts
data ExtendContext c e Source
A context transformer, for augmenting a context with additional information.
(ExtendPath c crumb, ExtendPath e crumb) => ExtendPath (ExtendContext c e) crumb | Both components of the context are updated with the crumb. |
extendContext :: e -> c -> ExtendContext c eSource
Extend a context with some additional information.
baseContext :: ExtendContext c e -> cSource
Retrieve the base context (without the extra information).
extraContext :: ExtendContext c e -> eSource
Retrieve the extra contextual information.