Version 5.4.2.2, November 2008 |
Kown bug:
New since the last version (June 2008):
The functional graph library for Haskell provides several modules that define inductive graphs and graph algorithms. An older version for ML can be found here.
To use the library:
runhaskell Setup.hs configure
runhaskell Setup.hs build
runhaskell Setup.hs install
runhaskell Setup.hs register
ghci test.hsPrint some test values, e.g.:
*Main> t2Apply graph algorithms:
Loading package fgl ... linking ... done.
1:"shorts"->[((),4),((),5)]
2:"socks"->[((),5)]
3:"watch"->[((),4)]
4:"pants"->[((),7),((),5)]
5:"shoes"->[]
6:"shirt"->[((),3),((),8),((),7)]
7:"belt"->[((),9)]
8:"tie"->[((),9)]
9:"jacket"->[]
*Main> topsort t2
[6,8,3,2,1,4,5,7,9]
*Main> topsort' t2
["shirt","tie","watch","socks","shorts","pants","shoes","belt","jacket"]
cp -R Data/Graph /usr/local/lib/hugs/libraries/Data
hugs -98
Prelude> :l Data.Graph.Inductive.Example
Data.Graph.Inductive.Example> clr486
1:"shorts"->[((),4),((),5)]
2:"socks"->[((),5)]
3:"watch"->[]
4:"pants"->[((),5),((),7)]
5:"shoes"->[]
6:"shirt"->[((),7),((),8)]
7:"belt"->[((),9)]
8:"tie"->[((),9)]
9:"jacket"->[] :: Gr String ()
Data.Graph.Inductive.Example> topsort clr486or even better:
[6,8,3,2,1,4,7,9,5]
Data.Graph.Inductive.Example> topsort' clr486
["shirt","tie","watch","socks","shorts","pants","belt","jacket","shoes"]
You can find more information in the (very old) User Guide [ps.gz] [pdf]. Note: The User Guide refers to the March 2001 version of the FGL; it has not been updated to reflect the extensions and changes of the current version.
The previous versions of the FGL can be accessed here: June 2008 version, May 2008 version, April 2007 version, June 2006 version, February 2005 version, January 2004 version, September 2002 version.
The library contains not just a couple of graph algorithms, but rather builds upon a functional view of graphs and graph algorithms. This view is motivated and explained in the paper Inductive Graphs and Functional Graph Algorithms.
Please send questions, comments, and bug reports to Martin Erwig.
last change: December 26, 2009 | Martin Erwig  erwig@eecs.oregonstate.edu |