graph-rewriting-0.4.8: Monadic graph rewriting of hypergraphs with ports and multiedges

Data.View

Description

The multi-parameter type-class View provides an abstraction View v n of a type n that exposes a value of type (v). It allows both to inspect and update the value, while hiding the internal structure of the value type (n).

Synopsis

Documentation

class View v n whereSource

Minimal complete definition: inspect and one of {update, adjust}

Methods

inspect :: n -> vSource

update :: v -> n -> nSource

adjust :: (v -> v) -> n -> nSource

examine :: View v n => (v -> field) -> n -> fieldSource

convenience function that can be used to access record fields of the exposed type

adjustM :: (Monad m, View v n) => (v -> m v) -> n -> m nSource