a documented interface for bag.ml
give bags a purity-friendly interface