static ItIt singletonIterator(A a) { ret new ItIt { bool returned; public A next() { if (returned) ret a with returned = false; else fail(); } public bool hasNext() { ret !returned; } }; }