// pred: func(S) -> bool static L mapLike splitAtLinePredicate(O pred, S text) { L lines = toLines(text); new L l; int i = 0; while (i < l(lines)) { int j = i; while (j < l(lines) && !callPred(pred, lines.get(j))) ++j; if (j > i) l.add(joinLines(lines.subList(i, j))); i = j+1; } ret l; }