-- A module for creating and handling directed graphs module Digraph (AdjList, Digraph, Edge, insertVertex, insertEdge, makeDigraph, getAdj, empty, vertexInGraph ) where -- In these type declarations, v is the vertex type -- and e is the edge label type type AdjList v e = [(v, e)] type Digraph v e = [(v, AdjList v e)] type Edge v e = (v, v, e) empty :: Digraph v e insertVertex :: (Eq v) => v -> Digraph v e -> Digraph v e insertEdge :: (Eq v) => Edge v e -> Digraph v e -> Digraph v e makeDigraph :: (Eq v) => [v] -> [Edge v e] -> Digraph v e getAdj :: (Eq v) => v -> Digraph v e -> AdjList v e vertexInGraph :: (Eq v) => v -> Digraph v e -> Bool