Stephen Dolan's pearl "Fun with semirings" might be relevant:
http://stedolan.net/research/semirings.pdf
But I would also like to know what other resources Neel has to recommend.
If you like Matlab more than Haskell, try https://www.goodreads.com/book/show/11768822-graph-algorithm...
Where can I read more about this?