graphite-0.10.0.1: Graphs and networks library

Safe HaskellNone
LanguageHaskell2010

Data.Graph.Read

Contents

Synopsis

CSV

fromCsv :: Graph g => (Hashable v, Eq v, FromField v) => FilePath -> IO (Either String (g v ())) Source #

Read a graph from a CSV file of adjacency lists

The CSV lines:

"1,2,3,4"
"2,1,4,5"

produce the graph with this list of edge pairs:

[(1, 2), (1, 3), (1, 4), (2, 1), (2, 4), (2, 5)]

fromCsv' :: Graph g => (Hashable v, Eq v, FromField v) => FilePath -> IO (g v ()) Source #

Same as fromCsv but rise an exception when parsing fails