fgl
fgl copied to clipboard
DynGraph contraint seems redundant in prettify
-- | Pretty-print the graph. Note that this loses a lot of
-- information, such as edge inverses, etc.
prettify :: (DynGraph gr, Show a, Show b) => gr a b -> String
prettify g = foldr (showsContext . context g) id (nodes g) ""
where
showsContext (_,n,l,s) sg = shows n . (':':) . shows l
. showString "->" . shows s
. ('\n':) . sg