A purely functional algebraic graph library