cycle with some mutable state map / filter / fold Graph Complex cycle with mutable state and stack or queue map / filter / fold Tree Complex cycle with mutable state and stack or queue map / filter / fold Set For cycle with some mutable state map / filter / fold
self.foldr( lambda r, x: \ r.cons(f(x)), self.mempty()) @classmethod def pure(cls, x): return List(x) def liftA2(self, other, f): return List(*[f(s, o) for s in iter(self) for o in iter(other)])