Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hand-rolled lenses on e-graphs and e-classes which come in quite handy and
are heavily used in Graph
.
Synopsis
- type Lens' s a = forall f. Functor f => (a -> f a) -> s -> f s
- _class :: ClassId -> Lens' (EGraph l) (EClass l)
- _memo :: Lens' (EGraph l) (Memo l)
- _classes :: Lens' (EGraph l) (ClassIdMap (EClass l))
- _data :: Lens' (EClass l) (Domain l)
- _parents :: Lens' (EClass l) (NodeMap l ClassId)
- _nodes :: Lens' (EClass l) (Set (ENode l))
- (^.) :: s -> Lens' s a -> a
- (.~) :: Lens' s a -> a -> s -> s
- (%~) :: Lens' s a -> (a -> a) -> s -> s
- view :: Lens' s a -> s -> a
- set :: Lens' s a -> a -> s -> s
- over :: Lens' s a -> (a -> a) -> s -> s
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
_classes :: Lens' (EGraph l) (ClassIdMap (EClass l)) Source #
Lens for the map of existing classes by id in an e-graph