dist/script/prelude/array.js
function takeWhile(f, xs) {
    const ys = [];
    for (const x of xs) {
        if (f(x)) {
            ys.push(x);
        }
        else {
            break;
        }
    }
    return ys;
}
function takeWhile(f, xs) {
    const ys = [];
    for (const x of xs) {
        if (f(x)) {
            ys.push(x);
        }
        else {
            break;
        }
    }
    return ys;
}
function takeWhile ( f , xs ) { const ys = [ ] ; for ( const x of xs ) { if ( f ( x ) ) { ys . push ( x ) ; } else { break ; } } return ys ; }
Returns the longest prefix of elements that satisfy the predicate
Returns the longest prefix of elements that satisfy the predicate