// fixme: split things out into core and rest?
// fixme: add documentation
// fixme: make replace empty a lazy static?
// fixme: make fold argument non-mutable?
