A Perl library for algebraic data structures