Skip to content
Snippets Groups Projects
Commit c03e2dfb authored by MeiMei's avatar MeiMei Committed by Acid Chicken (硫酸鶏)
Browse files

Change naming (#3678)

* Change naming

* x to a
parent 45c5e7b9
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
/**
......
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>;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment