Skip to content

Commit

Permalink
add v3 comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Jun 16, 2020
1 parent 392bd64 commit d77e40a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/Ord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const ordBoolean: Ord<boolean> = {
compare
}

// TODO: curry in v3
/**
* Test whether one value is _strictly less than_ another
*
Expand All @@ -72,6 +73,7 @@ export function lt<A>(O: Ord<A>): (x: A, y: A) => boolean {
return (x, y) => O.compare(x, y) === -1
}

// TODO: curry in v3
/**
* Test whether one value is _strictly greater than_ another
*
Expand All @@ -81,6 +83,7 @@ export function gt<A>(O: Ord<A>): (x: A, y: A) => boolean {
return (x, y) => O.compare(x, y) === 1
}

// TODO: curry in v3
/**
* Test whether one value is _non-strictly less than_ another
*
Expand All @@ -90,6 +93,7 @@ export function leq<A>(O: Ord<A>): (x: A, y: A) => boolean {
return (x, y) => O.compare(x, y) !== 1
}

// TODO: curry in v3
/**
* Test whether one value is _non-strictly greater than_ another
*
Expand All @@ -99,6 +103,7 @@ export function geq<A>(O: Ord<A>): (x: A, y: A) => boolean {
return (x, y) => O.compare(x, y) !== -1
}

// TODO: curry in v3
/**
* Take the minimum of two values. If they are considered equal, the first argument is chosen
*
Expand All @@ -108,6 +113,7 @@ export function min<A>(O: Ord<A>): (x: A, y: A) => A {
return (x, y) => (O.compare(x, y) === 1 ? y : x)
}

// TODO: curry in v3
/**
* Take the maximum of two values. If they are considered equal, the first argument is chosen
*
Expand Down
8 changes: 4 additions & 4 deletions src/ReadonlyArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ export function elem<A>(
(a: A, as: ReadonlyArray<A>): boolean
}
export function elem<A>(E: Eq<A>): (a: A, as?: ReadonlyArray<A>) => boolean | ((as: ReadonlyArray<A>) => boolean) {
return (a, as) => {
return (a, as?) => {
if (as === undefined) {
const elemE = elem(E)
return (as) => elemE(a, as)
Expand Down Expand Up @@ -1329,7 +1329,7 @@ export function union<A>(
E: Eq<A>
): (xs: ReadonlyArray<A>, ys?: ReadonlyArray<A>) => ReadonlyArray<A> | ((ys: ReadonlyArray<A>) => ReadonlyArray<A>) {
const elemE = elem(E)
return (xs, ys) => {
return (xs, ys?) => {
if (ys === undefined) {
const unionE = union(E)
return (ys) => unionE(ys, xs)
Expand Down Expand Up @@ -1366,7 +1366,7 @@ export function intersection<A>(
E: Eq<A>
): (xs: ReadonlyArray<A>, ys?: ReadonlyArray<A>) => ReadonlyArray<A> | ((ys: ReadonlyArray<A>) => ReadonlyArray<A>) {
const elemE = elem(E)
return (xs, ys) => {
return (xs, ys?) => {
if (ys === undefined) {
const intersectionE = intersection(E)
return (ys) => intersectionE(ys, xs)
Expand Down Expand Up @@ -1400,7 +1400,7 @@ export function difference<A>(
E: Eq<A>
): (xs: ReadonlyArray<A>, ys?: ReadonlyArray<A>) => ReadonlyArray<A> | ((ys: ReadonlyArray<A>) => ReadonlyArray<A>) {
const elemE = elem(E)
return (xs, ys) => {
return (xs, ys?) => {
if (ys === undefined) {
const differenceE = difference(E)
return (ys) => differenceE(ys, xs)
Expand Down
6 changes: 3 additions & 3 deletions src/ReadonlyMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function member<K>(
}
export function member<K>(E: Eq<K>): <A>(k: K, m?: ReadonlyMap<K, A>) => boolean | ((m: ReadonlyMap<K, A>) => boolean) {
const lookupE = lookup(E)
return (k, m) => {
return (k, m?) => {
if (m === undefined) {
const memberE = member(E)
return (m) => memberE(k, m)
Expand All @@ -120,7 +120,7 @@ export function elem<A>(
<K>(a: A, m: ReadonlyMap<K, A>): boolean
}
export function elem<A>(E: Eq<A>): <K>(a: A, m?: ReadonlyMap<K, A>) => boolean | ((m: ReadonlyMap<K, A>) => boolean) {
return (a, m) => {
return (a, m?) => {
if (m === undefined) {
const elemE = elem(E)
return (m) => elemE(a, m)
Expand Down Expand Up @@ -349,7 +349,7 @@ export function lookup<K>(
E: Eq<K>
): <A>(k: K, m?: ReadonlyMap<K, A>) => Option<A> | ((m: ReadonlyMap<K, A>) => Option<A>) {
const lookupWithKeyE = lookupWithKey(E)
return (k, m) => {
return (k, m?) => {
if (m === undefined) {
const lookupE = lookup(E)
return (m) => lookupE(k, m)
Expand Down
2 changes: 1 addition & 1 deletion src/Semigroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function fold<A>(
(a: A, as: ReadonlyArray<A>): A
}
export function fold<A>(S: Semigroup<A>): (a: A, as?: ReadonlyArray<A>) => A | ((as: ReadonlyArray<A>) => A) {
return (a, as) => {
return (a, as?) => {
if (as === undefined) {
const foldS = fold(S)
return (as) => foldS(a, as)
Expand Down
1 change: 1 addition & 0 deletions src/Tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export function unfoldForestM<M>(
)
}

// TODO: curry in v3
/**
* @since 2.0.0
*/
Expand Down

0 comments on commit d77e40a

Please sign in to comment.