{- TODO: merge the type Rel2 and DepGraph in order to work only on the
new type, and implement a construction of this graph from a list
without the necessity to order the elements first. -}

{- | It is important to have the elements given in an order with
biggest elements first (elements which depend on nothing) -}
depGraphFromDescList :: (Ord a, Ord c) => (a -> b -> [c]) ->
                        (c -> a) -> [(a, b)] -> DepGraph a b c
depGraphFromDescList f pf = foldl g (emptyDepGraph f pf) where
    g x (y, z) = updateGraph x y z
depGraphFromDescList :: (Ord a, Ord c) => (a -> b -> [c]) ->
                        (c -> a) -> [(a, b)] -> DepGraph a b c
depGraphFromDescList f pf = foldl g (emptyDepGraph f pf) where
    g x (y, z) = updateGraph x y z
depGraphFromDescList f pf = foldl g (emptyDepGraph f pf) where
    g x (y, z) = updateGraph x y z