kolektiv

Andrew Cherry

Hekate — Functional Graphs for F#

While working on Freya lately (specifically the Machine part of Freya, which treats responding to HTTP requests as a graph problem — under the hood at least) I decided to pull out the ad-hoc graph code which had grown up in Freya and turn it in to a small self-contained library for working with general graphs in F#.

Of course, even the best plans rarely survive contact with the enemy (in this case “reading up on functional graphs”) and I ended up completely changing the implementation away from the model I’d used in Freya.

An early (but usable/useful) version of Hekate is available over here on GitHub and on NuGet, and I’ll be writing up some decent user documentation and a guide at some point soon. However, for now the source is quite “literate” in commentary style, so if you are interested, it’s probably worth a look.

One thing to note is that it’s based on an inductive definition of graphs, and it might serve as quite a good introduction to that. I know that writing it taught me quite a few new things about structuring complex systems based on a few basic axiomatic principles. The paper it was based on — which will make the design a lot clearer — is Inductive Graphs and Functional Graph Algorithms. The Haskell FGL graph library is an implementation of this paper.

More soon on Hekate…