6 module Types.Data.Graph.RootPath
13 import qualified Types.Data.List as L
14 import qualified Types.Data.List.Ops as L
16 import Types.Data.Bool
17 import Types.Data.Graph
21 type family NodeID lNode
22 type instance NodeID (LNode nodeID nodeLabel) = nodeID
26 type instance L.App NodeIDA lNode = NodeID lNode
29 type family NodeLabel lNode
30 type instance NodeLabel (LNode nodeID nodeLabel) = nodeLabel
33 type family FindP node lPaths
34 type instance FindP n L.Null = L.Null
35 type instance FindP n (L.Cons (LPath L.Null) ps) = FindP n ps
36 type instance FindP n (L.Cons (LPath (L.Cons (LNode n' l) ns)) ps)
38 (L.Cons (LNode n' l) ns)
42 type GetLPath node lPaths
43 = LPath (GetLPath' node lPaths)
46 type GetLPath' node lPaths
47 = L.Reverse (FindP node lPaths)
50 type GetDistance node lPaths
51 = NodeLabel (L.Head (FindP node lPaths))
54 type GetLPathNodes node lPaths
55 = L.Map NodeIDA (GetLPath' node lPaths)