index.js
function listFold(list, z, f, n) {
  if (n < list.length) {
    return f(list[n], function () {
      return listFold(list, z, f, n + 1);
    });
  } else {
    return z;
  }
}
function listFold(list, z, f, n) {
  if (n < list.length) {
    return f(list[n], function () {
      return listFold(list, z, f, n + 1);
    });
  } else {
    return z;
  }
}
function listFold ( list , z , f , n ) { if ( n < list . length ) { return f ( list [ n ] , function ( ) { return listFold ( list , z , f , n + 1 ) ; } ) ; } else { return z ; } }
- *fold : (seq : Seq a | Array a, z : b, f : (a, () → b) → b) : b* &mdash; polymorphic version of fold. Works with arrays too.
- * fold : ( seq : Seq a | Array a z : b f : ( a () → b ) → b ) : b * &mdash ; polymorphic version of fold . Works with arrays too .