Proof principles for datatypes with iterated recursion