Clojure implementation of backtracking iterators (https://www.lri.fr/~filliatr/publis/enum2.pdf)