// pred: char -> bool sS takeCharsWhile(S s, O pred) { int i = 0; while (i < l(s) && isTrue(callF(pred, s.charAt(i)))) ++i; ret substring(s, 0, i); } sS lambdaMapLike takeCharsWhile(IPred f, S s) { ret takeCharsWhile(s, f); }