Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hand-rolled lenses on e-graphs and e-classes which come in quite handy, are
heavily used in Graph
, and are the only exported way of
editing the structure of the e-graph. If you want to write some complex
Analysis
you'll probably need these.
Synopsis
- type Lens' s a = forall f. Functor f => (a -> f a) -> s -> f s
- _class :: ClassId -> Lens' (EGraph a l) (EClass a l)
- _memo :: Lens' (EGraph a l) (NodeMap l ClassId)
- _classes :: Lens' (EGraph a l) (ClassIdMap (EClass a l))
- _data :: Lens' (EClass domain l) domain
- _parents :: Lens' (EClass a l) (SList (ClassId, ENode l))
- _nodes :: Lens' (EClass a 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 a l) (EClass a 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 a l) (NodeMap l ClassId) Source #
Lens for the memo of e-nodes in an e-graph, that is, a mapping from e-nodes to the e-class they're represented in
_classes :: Lens' (EGraph a l) (ClassIdMap (EClass a l)) Source #
Lens for the map of existing classes by id in an e-graph