Tuple2<IList<A>, IList<A>> partition(bool f(A a)) => foldRight(tuple2(nil(), nil()), (A a, acc) => f(a) ? acc.map1((xs) => cons(a, xs)) : acc.map2((xs) => cons(a, xs)));