hegg-0.1.0.0: Fast equality saturation in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Equality.Graph.Lens

Description

Hand-rolled lenses on e-graphs and e-classes which come in quite handy and are heavily used in Graph.

Synopsis

Documentation

type Lens' s a = forall f. Functor f => (a -> f a) -> s -> f s Source #

A Lens' as defined in other lenses libraries

_class :: ClassId -> Lens' (EGraph l) (EClass l) Source #

Lens for the e-class with the given id in an e-graph

Calls error when the e-class doesn't exist

_memo :: Lens' (EGraph l) (Memo l) Source #

Lens for the Memo of e-nodes in an e-graph

_classes :: Lens' (EGraph l) (ClassIdMap (EClass l)) Source #

Lens for the map of existing classes by id in an e-graph

_data :: Lens' (EClass l) (Domain l) Source #

Lens for the Domain of an e-class

_parents :: Lens' (EClass l) (NodeMap l ClassId) Source #

Lens for the parent e-classes of an e-class

_nodes :: Lens' (EClass l) (Set (ENode l)) Source #

Lens for the e-nodes in an e-class

(^.) :: s -> Lens' s a -> a infixl 8 Source #

Like view but with the arguments flipped

(.~) :: Lens' s a -> a -> s -> s infixr 4 Source #

Synonym for set

(%~) :: Lens' s a -> (a -> a) -> s -> s infixr 4 Source #

Synonym for over

view :: Lens' s a -> s -> a Source #

Applies a getter to a value

set :: Lens' s a -> a -> s -> s Source #

Applies a setter to a value

over :: Lens' s a -> (a -> a) -> s -> s Source #

Applies a function to the target