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
- type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
- _class :: ClassId -> Lens' (EGraph a l) (EClass a l)
- _memo :: Lens' (EGraph a l) (NodeMap l ClassId)
- _classes :: Traversal (EGraph a l) (EGraph b l) (EClass a l) (EClass b l)
- _iclasses :: Traversal (EGraph a l) (EGraph b l) (ClassId, EClass a l) (EClass b 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
- allOf :: Traversal s t a b -> (a -> Bool) -> s -> Bool
Documentation
type Lens' s a = forall f. Functor f => (a -> f a) -> s -> f s Source #
A Lens'
as defined in other lenses libraries
type Traversal s t a b = forall f. Applicative f => (a -> f b) -> s -> f t Source #
_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 :: Traversal (EGraph a l) (EGraph b l) (EClass a l) (EClass b l) Source #
Traversal for the existing classes in an e-graph
_iclasses :: Traversal (EGraph a l) (EGraph b l) (ClassId, EClass a l) (EClass b l) Source #
Traversal for the existing classes in an e-graph