Fix comment

This commit is contained in:
Aya Morisawa 2018-12-19 10:02:58 +09:00
parent 2ee438dece
commit 624fd093f2
No known key found for this signature in database
GPG key ID: 3E64865D70D579F2

View file

@ -59,7 +59,7 @@ export function maximum(xs: number[]): number {
/**
* Splits an array based on the equivalence relation.
* The concatenation of the result equals to the argument.
* The concatenation of the result is equal to the argument.
*/
export function groupBy<T>(f: (x: T, y: T) => boolean, xs: T[]): T[][] {
const groups = [] as T[][];
@ -75,7 +75,7 @@ export function groupBy<T>(f: (x: T, y: T) => boolean, xs: T[]): T[][] {
/**
* Splits an array based on the equivalence relation induced by the function.
* The concatenation of the result equals to the argument.
* The concatenation of the result is equal to the argument.
*/
export function groupOn<T, S>(f: (x: T) => S, xs: T[]): T[][] {
return groupBy((a, b) => f(a) === f(b), xs);