7 module Types.Data.Graph.RootPath
14 import qualified Types.Data.List as L
15 import qualified Types.Data.List.Ops as L
17 import Types.Data.Bool
18 import Types.Data.Graph
22 type family NodeID lNode
23 type instance NodeID (LNode nodeID nodeLabel) = nodeID
27 type instance L.App NodeIDA lNode = NodeID lNode
30 type family NodeLabel lNode
31 type instance NodeLabel (LNode nodeID nodeLabel) = nodeLabel
34 type family FindP node lPaths
35 type instance FindP n L.Null = L.Null
36 type instance FindP n (L.Cons (LPath L.Null) ps) = FindP n ps
37 type instance FindP n (L.Cons (LPath (L.Cons (LNode n' l) ns)) ps)
39 (L.Cons (LNode n' l) ns)
43 type GetLPath node lPaths
44 = LPath (GetLPath' node lPaths)
47 type GetLPath' node lPaths
48 = L.Reverse (FindP node lPaths)
51 type GetDistance node lPaths
52 = NodeLabel (L.Head (FindP node lPaths))
55 type GetLPathNodes node lPaths
56 = L.Map NodeIDA (GetLPath' node lPaths)