{-|
  Description : 'Data.Graph' with a few extra functions.
  Copyright   : (c) Paul Govereau and Jean-Baptiste Tristan 2010
  License     : All Rights Reserved
  Maintainer  : Paul Govereau <govereau@cs.harvard.edu>

  Interface to 'Data.Graph' with a few extra functions.
-}
module MD.Graph
  ( module Data.Graph, suc, pre )
where
import Data.Array
import Data.Graph

-- | Successors of a node

suc :: Graph -> Vertex -> [Vertex]
suc g v = g ! v

-- | Predecessors of a node

pre :: Graph -> Vertex -> [Vertex]
pre g v = [ x | (x,v') <- edges g, v == v' ]