Rename forall and exists to all and any. I ended up liking these names better and they do not clash with the potential introduction of forall in types.

This commit is contained in:
evancz 2012-10-04 00:37:58 -04:00
parent d0bf8667c2
commit 8b72e0db01
2 changed files with 6 additions and 6 deletions

View file

@ -191,12 +191,12 @@ var List = function() {
return concat(map(f_76)(x)) return concat(map(f_76)(x))
} }
} }
function forall(pred) { function all(pred) {
return foldl(function(x) { return function(acc) { return foldl(function(x) { return function(acc) {
return acc && pred(x); return acc && pred(x);
};})(true); };})(true);
} }
function exists(pred) { function any(pred) {
return foldl(function(x) { return function(acc) { return foldl(function(x) { return function(acc) {
return acc || pred(x); return acc || pred(x);
};})(false); };})(false);
@ -464,8 +464,8 @@ var List = function() {
concatMap:concatMap, concatMap:concatMap,
and:and, and:and,
or:or, or:or,
forall:forall, all:all,
exists:exists, any:any,
sum:sum, sum:sum,
product:product, product:product,
maximum:maximum, maximum:maximum,

View file

@ -77,8 +77,8 @@ var Prelude = function() {
foldl1 : Data.List.foldl1, foldl1 : Data.List.foldl1,
and : Data.List.and, and : Data.List.and,
or : Data.List.or, or : Data.List.or,
forall : Data.List.forall, all : Data.List.all,
exists : Data.List.exists, any : Data.List.any,
sum : Data.List.sum, sum : Data.List.sum,
product : Data.List.product, product : Data.List.product,
concat : Data.List.concat, concat : Data.List.concat,