Comparing version 0.2.2 to 0.2.3
@@ -15,2 +15,7 @@ # Changelog | ||
# 0.2.3 | ||
- **Bug Fix** | ||
- fix return types of `validation.success` / `validation.failure` (@gcanti) | ||
# 0.2.2 | ||
@@ -17,0 +22,0 @@ |
@@ -42,2 +42,3 @@ import { HKT, HKTS, HKT2, HKT2S } from './HKT'; | ||
fold<B>(left: (l: L) => B, right: (a: A) => B): B; | ||
getOrElse(f: Lazy<A>): A; | ||
equals(setoid: StaticSetoid<A>, fy: Either<L, A>): boolean; | ||
@@ -68,2 +69,3 @@ mapLeft<L2>(f: (l: L) => L2): Either<L2, A>; | ||
fold<B>(left: (l: L) => B, right: (a: A) => B): B; | ||
getOrElse(f: Lazy<A>): A; | ||
equals(setoid: StaticSetoid<A>, fy: Either<L, A>): boolean; | ||
@@ -77,2 +79,3 @@ mapLeft<L2>(f: (l: L) => L2): Either<L2, A>; | ||
export declare function fold<L, A, B>(left: (l: L) => B, right: (a: A) => B, fa: Either<L, A>): B; | ||
export declare function getOrElse<L, A>(f: () => A, fa: Either<L, A>): A; | ||
export declare function map<L, A, B>(f: (a: A) => B, fa: Either<L, A>): Either<L, B>; | ||
@@ -79,0 +82,0 @@ export declare function of<L, A>(a: A): Right<L, A>; |
@@ -40,2 +40,5 @@ import { tailRec } from './ChainRec'; | ||
}; | ||
Left.prototype.getOrElse = function (f) { | ||
return f(); | ||
}; | ||
Left.prototype.equals = function (setoid, fy) { | ||
@@ -98,2 +101,5 @@ return fy.fold(constTrue, constFalse); | ||
}; | ||
Right.prototype.getOrElse = function (f) { | ||
return this.value; | ||
}; | ||
Right.prototype.equals = function (setoid, fy) { | ||
@@ -125,2 +131,5 @@ var _this = this; | ||
} | ||
export function getOrElse(f, fa) { | ||
return fa.getOrElse(f); | ||
} | ||
export function map(f, fa) { | ||
@@ -127,0 +136,0 @@ return fa.map(f); |
@@ -85,3 +85,5 @@ import { HKT, HKTS, HKT2, HKT2S } from './HKT'; | ||
export declare function of<L, A>(a: A): Success<L, A>; | ||
export declare function getApplicativeS<L>(semigroup: StaticSemigroup<L>): StaticApplicative<URI>; | ||
export declare function getStaticApplicative<L>(semigroup: StaticSemigroup<L>): StaticApplicative<URI>; | ||
/** deprecated, use getStaticApplicative instead */ | ||
export declare const getApplicativeS: typeof getStaticApplicative; | ||
export declare function bimap<L, L2, A, B>(semigroup: StaticSemigroup<L2>, f: (l: L) => L2, g: (a: A) => B, fa: Validation<L, A>): Validation<L2, B>; | ||
@@ -94,4 +96,4 @@ export declare function alt<L, A>(fx: Validation<L, A>, fy: Validation<L, A>): Validation<L, A>; | ||
export declare function isSuccess<L, A>(fa: Validation<L, A>): fa is Success<L, A>; | ||
export declare function failure<L, A>(semigroup: StaticSemigroup<L>, l: L): Failure<L, A>; | ||
export declare function success<L, A>(a: A): Success<L, A>; | ||
export declare function failure<L, A>(semigroup: StaticSemigroup<L>, l: L): Validation<L, A>; | ||
export declare function success<L, A>(a: A): Validation<L, A>; | ||
export declare function fromPredicate<L, A>(semigroup: StaticSemigroup<L>, predicate: Predicate<A>, l: (a: A) => L): (a: A) => Validation<L, A>; | ||
@@ -98,0 +100,0 @@ export declare function concat<L, A>(fx: Validation<L, A>, fy: Validation<L, A>): Validation<L, A>; |
@@ -149,3 +149,3 @@ import { constFalse, constTrue } from './function'; | ||
} | ||
export function getApplicativeS(semigroup) { | ||
export function getStaticApplicative(semigroup) { | ||
function ap(fab, fa) { | ||
@@ -156,2 +156,4 @@ return fa.ap(fab); | ||
} | ||
/** deprecated, use getStaticApplicative instead */ | ||
export var getApplicativeS = getStaticApplicative; | ||
export function bimap(semigroup, f, g, fa) { | ||
@@ -158,0 +160,0 @@ return fa.bimap(semigroup, f, g); |
@@ -42,2 +42,3 @@ import { HKT, HKTS, HKT2, HKT2S } from './HKT'; | ||
fold<B>(left: (l: L) => B, right: (a: A) => B): B; | ||
getOrElse(f: Lazy<A>): A; | ||
equals(setoid: StaticSetoid<A>, fy: Either<L, A>): boolean; | ||
@@ -68,2 +69,3 @@ mapLeft<L2>(f: (l: L) => L2): Either<L2, A>; | ||
fold<B>(left: (l: L) => B, right: (a: A) => B): B; | ||
getOrElse(f: Lazy<A>): A; | ||
equals(setoid: StaticSetoid<A>, fy: Either<L, A>): boolean; | ||
@@ -77,2 +79,3 @@ mapLeft<L2>(f: (l: L) => L2): Either<L2, A>; | ||
export declare function fold<L, A, B>(left: (l: L) => B, right: (a: A) => B, fa: Either<L, A>): B; | ||
export declare function getOrElse<L, A>(f: () => A, fa: Either<L, A>): A; | ||
export declare function map<L, A, B>(f: (a: A) => B, fa: Either<L, A>): Either<L, B>; | ||
@@ -79,0 +82,0 @@ export declare function of<L, A>(a: A): Right<L, A>; |
@@ -42,2 +42,5 @@ "use strict"; | ||
}; | ||
Left.prototype.getOrElse = function (f) { | ||
return f(); | ||
}; | ||
Left.prototype.equals = function (setoid, fy) { | ||
@@ -100,2 +103,5 @@ return fy.fold(function_1.constTrue, function_1.constFalse); | ||
}; | ||
Right.prototype.getOrElse = function (f) { | ||
return this.value; | ||
}; | ||
Right.prototype.equals = function (setoid, fy) { | ||
@@ -129,2 +135,6 @@ var _this = this; | ||
exports.fold = fold; | ||
function getOrElse(f, fa) { | ||
return fa.getOrElse(f); | ||
} | ||
exports.getOrElse = getOrElse; | ||
function map(f, fa) { | ||
@@ -131,0 +141,0 @@ return fa.map(f); |
@@ -85,3 +85,5 @@ import { HKT, HKTS, HKT2, HKT2S } from './HKT'; | ||
export declare function of<L, A>(a: A): Success<L, A>; | ||
export declare function getApplicativeS<L>(semigroup: StaticSemigroup<L>): StaticApplicative<URI>; | ||
export declare function getStaticApplicative<L>(semigroup: StaticSemigroup<L>): StaticApplicative<URI>; | ||
/** deprecated, use getStaticApplicative instead */ | ||
export declare const getApplicativeS: typeof getStaticApplicative; | ||
export declare function bimap<L, L2, A, B>(semigroup: StaticSemigroup<L2>, f: (l: L) => L2, g: (a: A) => B, fa: Validation<L, A>): Validation<L2, B>; | ||
@@ -94,4 +96,4 @@ export declare function alt<L, A>(fx: Validation<L, A>, fy: Validation<L, A>): Validation<L, A>; | ||
export declare function isSuccess<L, A>(fa: Validation<L, A>): fa is Success<L, A>; | ||
export declare function failure<L, A>(semigroup: StaticSemigroup<L>, l: L): Failure<L, A>; | ||
export declare function success<L, A>(a: A): Success<L, A>; | ||
export declare function failure<L, A>(semigroup: StaticSemigroup<L>, l: L): Validation<L, A>; | ||
export declare function success<L, A>(a: A): Validation<L, A>; | ||
export declare function fromPredicate<L, A>(semigroup: StaticSemigroup<L>, predicate: Predicate<A>, l: (a: A) => L): (a: A) => Validation<L, A>; | ||
@@ -98,0 +100,0 @@ export declare function concat<L, A>(fx: Validation<L, A>, fy: Validation<L, A>): Validation<L, A>; |
@@ -155,3 +155,3 @@ "use strict"; | ||
exports.of = of; | ||
function getApplicativeS(semigroup) { | ||
function getStaticApplicative(semigroup) { | ||
function ap(fab, fa) { | ||
@@ -162,3 +162,5 @@ return fa.ap(fab); | ||
} | ||
exports.getApplicativeS = getApplicativeS; | ||
exports.getStaticApplicative = getStaticApplicative; | ||
/** deprecated, use getStaticApplicative instead */ | ||
exports.getApplicativeS = getStaticApplicative; | ||
function bimap(semigroup, f, g, fa) { | ||
@@ -165,0 +167,0 @@ return fa.bimap(semigroup, f, g); |
{ | ||
"name": "fp-ts", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Functional programming in TypeScript", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
394071
6423