Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.DAWG.Node
Description
Internal representation of automata nodes.
Synopsis
- data Node t a b
- onSym :: Trans t => Sym -> Node t a b -> Maybe ID
- onSym' :: (Trans t, Unbox a) => Sym -> Node t a b -> Maybe (ID, a)
- edges :: Trans t => Node t a b -> [(Sym, ID)]
- children :: Trans t => Node t a b -> [ID]
- insert :: Trans t => Sym -> ID -> Node t a b -> Node t a b
- reID :: Trans t => (ID -> ID) -> Node t a b -> Node t a b
Documentation
Two nodes (states) belong to the same equivalence class (and, consequently, they must be represented as one node in the graph) iff they are equal with respect to their values and outgoing edges.
Since Leaf
nodes are distinguished from Branch
nodes, two values
equal with respect to ==
function are always kept in one Leaf
node in the graph. It doesn't change the fact that to all Branch
nodes one value is assigned through the epsilon transition.
Invariant: the eps
identifier always points to the Leaf
node.
Edges in the edgeMap
, on the other hand, point to Branch
nodes.
Instances
(Eq a, Eq b, Unbox a) => Eq (Node Trans a b) Source # | |
(Eq a, Eq b, Unbox a) => Eq (Node Trans a b) Source # | |
(Ord a, Ord b, Unbox a) => Ord (Node Trans a b) Source # | |
Defined in Data.DAWG.Node Methods compare :: Node Trans a b -> Node Trans a b -> Ordering # (<) :: Node Trans a b -> Node Trans a b -> Bool # (<=) :: Node Trans a b -> Node Trans a b -> Bool # (>) :: Node Trans a b -> Node Trans a b -> Bool # (>=) :: Node Trans a b -> Node Trans a b -> Bool # | |
(Ord a, Ord b, Unbox a) => Ord (Node Trans a b) Source # | |
Defined in Data.DAWG.Node Methods compare :: Node Trans a b -> Node Trans a b -> Ordering # (<) :: Node Trans a b -> Node Trans a b -> Bool # (<=) :: Node Trans a b -> Node Trans a b -> Bool # (>) :: Node Trans a b -> Node Trans a b -> Bool # (>=) :: Node Trans a b -> Node Trans a b -> Bool # | |
(Unbox a, Show t, Show a, Show b) => Show (Node t a b) Source # | |
(Unbox a, Binary t, Binary a, Binary b) => Binary (Node t a b) Source # | |
(Trans t, Ord (Node t a b)) => Hash (Node t a b) Source # | |
edges :: Trans t => Node t a b -> [(Sym, ID)] Source #
List of symbol/edge pairs outgoing from the node.