Change naming (#3678)

* Change naming

* x to a
This commit is contained in:
MeiMei 2018-12-19 22:38:27 +09:00 committed by Acid Chicken (硫酸鶏)
parent 5f92538a69
commit da198da133
2 changed files with 6 additions and 6 deletions

View File

@ -11,8 +11,8 @@ export function countIf<T>(f: Predicate<T>, xs: T[]): number {
/**
* Count the number of elements that is equal to the element
*/
export function count<T>(x: T, xs: T[]): number {
return countIf(y => x === y, xs);
export function count<T>(a: T, xs: T[]): number {
return countIf(x => x === a, xs);
}
/**
@ -33,8 +33,8 @@ export function intersperse<T>(sep: T, xs: T[]): T[] {
/**
* Returns the array of elements that is not equal to the element
*/
export function erase<T>(x: T, xs: T[]): T[] {
return xs.filter(y => x !== y);
export function erase<T>(a: T, xs: T[]): T[] {
return xs.filter(x => x !== a);
}
/**

View File

@ -1,5 +1,5 @@
export type Predicate<T> = (x: T) => boolean;
export type Predicate<T> = (a: T) => boolean;
export type Relation<T, U> = (x: T, y: U) => boolean;
export type Relation<T, U> = (a: T, b: U) => boolean;
export type EndoRelation<T> = Relation<T, T>;