fp-ts-contrib
Advanced tools
Comparing version 0.1.10 to 0.1.11
@@ -16,2 +16,8 @@ # Changelog | ||
# 0.1.11 | ||
- **New Feature** | ||
- `Zipper` | ||
- add missing pipeable combinators (@gcanti) | ||
# 0.1.10 | ||
@@ -18,0 +24,0 @@ |
@@ -163,2 +163,6 @@ /** | ||
) => <B>(fab: Zipper<(a: A) => B>) => Zipper<B>, | ||
apFirst: <B>(fb: Zipper<B>) => <A>(fa: Zipper<A>) => Zipper<A>, | ||
apSecond: <B>(fb: Zipper<B>) => <A>(fa: Zipper<A>) => Zipper<B>, | ||
duplicate: <A>(ma: Zipper<A>) => Zipper<Zipper<A>>, | ||
extend: <A, B>(f: (fa: Zipper<A>) => B) => (ma: Zipper<A>) => Zipper<B>, | ||
foldMap: <M>(M: Monoid<M>) => <A>(f: (a: A) => M) => (fa: Zipper<A>) => M, | ||
@@ -174,4 +178,20 @@ map: <A, B>(f: (a: A) => B) => (fa: Zipper<A>) => Zipper<B>, | ||
/** | ||
* @since 0.1.6 | ||
* @since 0.1.11 | ||
*/ | ||
apFirst, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
apSecond, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
duplicate, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
extend, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
foldMap, | ||
@@ -178,0 +198,0 @@ /** |
@@ -189,11 +189,2 @@ var __assign = (this && this.__assign) || function () { | ||
} | ||
function extend(fa, f) { | ||
var lefts = fa.lefts.map(function (a, i) { | ||
return f(make(pipe(fa.lefts, A.takeLeft(i)), a, A.snoc(pipe(fa.lefts, A.dropLeft(i + 1)), fa.focus).concat(fa.rights))); | ||
}); | ||
var rights = fa.rights.map(function (a, i) { | ||
return f(make(A.snoc(fa.lefts, fa.focus).concat(pipe(fa.rights, A.takeLeft(i))), a, pipe(fa.rights, A.dropLeft(i + 1)))); | ||
}); | ||
return make(lefts, f(fa), rights); | ||
} | ||
/** | ||
@@ -221,3 +212,11 @@ * @since 0.1.6 | ||
ap: function (fab, fa) { return make(A.array.ap(fab.lefts, fa.lefts), fab.focus(fa.focus), A.array.ap(fab.rights, fa.rights)); }, | ||
extend: extend, | ||
extend: function (fa, f) { | ||
var lefts = fa.lefts.map(function (a, i) { | ||
return f(make(pipe(fa.lefts, A.takeLeft(i)), a, A.snoc(pipe(fa.lefts, A.dropLeft(i + 1)), fa.focus).concat(fa.rights))); | ||
}); | ||
var rights = fa.rights.map(function (a, i) { | ||
return f(make(A.snoc(fa.lefts, fa.focus).concat(pipe(fa.rights, A.takeLeft(i))), a, pipe(fa.rights, A.dropLeft(i + 1)))); | ||
}); | ||
return make(lefts, f(fa), rights); | ||
}, | ||
extract: function (fa) { return fa.focus; }, | ||
@@ -238,3 +237,3 @@ reduce: function (fa, b, f) { return fa.rights.reduce(f, f(fa.lefts.reduce(f, b), fa.focus)); }, | ||
}; | ||
var _a = pipeable(zipper), ap = _a.ap, foldMap = _a.foldMap, map = _a.map, reduce = _a.reduce, reduceRight = _a.reduceRight; | ||
var _a = pipeable(zipper), ap = _a.ap, apFirst = _a.apFirst, apSecond = _a.apSecond, duplicate = _a.duplicate, extend = _a.extend, foldMap = _a.foldMap, map = _a.map, reduce = _a.reduce, reduceRight = _a.reduceRight; | ||
export { | ||
@@ -246,4 +245,20 @@ /** | ||
/** | ||
* @since 0.1.6 | ||
* @since 0.1.11 | ||
*/ | ||
apFirst, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
apSecond, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
duplicate, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
extend, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
foldMap, | ||
@@ -250,0 +265,0 @@ /** |
@@ -163,2 +163,6 @@ /** | ||
) => <B>(fab: Zipper<(a: A) => B>) => Zipper<B>, | ||
apFirst: <B>(fb: Zipper<B>) => <A>(fa: Zipper<A>) => Zipper<A>, | ||
apSecond: <B>(fb: Zipper<B>) => <A>(fa: Zipper<A>) => Zipper<B>, | ||
duplicate: <A>(ma: Zipper<A>) => Zipper<Zipper<A>>, | ||
extend: <A, B>(f: (fa: Zipper<A>) => B) => (ma: Zipper<A>) => Zipper<B>, | ||
foldMap: <M>(M: Monoid<M>) => <A>(f: (a: A) => M) => (fa: Zipper<A>) => M, | ||
@@ -174,4 +178,20 @@ map: <A, B>(f: (a: A) => B) => (fa: Zipper<A>) => Zipper<B>, | ||
/** | ||
* @since 0.1.6 | ||
* @since 0.1.11 | ||
*/ | ||
apFirst, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
apSecond, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
duplicate, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
extend, | ||
/** | ||
* @since 0.1.11 | ||
*/ | ||
foldMap, | ||
@@ -178,0 +198,0 @@ /** |
@@ -210,11 +210,2 @@ "use strict"; | ||
} | ||
function extend(fa, f) { | ||
var lefts = fa.lefts.map(function (a, i) { | ||
return f(make(pipeable_1.pipe(fa.lefts, A.takeLeft(i)), a, A.snoc(pipeable_1.pipe(fa.lefts, A.dropLeft(i + 1)), fa.focus).concat(fa.rights))); | ||
}); | ||
var rights = fa.rights.map(function (a, i) { | ||
return f(make(A.snoc(fa.lefts, fa.focus).concat(pipeable_1.pipe(fa.rights, A.takeLeft(i))), a, pipeable_1.pipe(fa.rights, A.dropLeft(i + 1)))); | ||
}); | ||
return make(lefts, f(fa), rights); | ||
} | ||
/** | ||
@@ -244,3 +235,11 @@ * @since 0.1.6 | ||
ap: function (fab, fa) { return make(A.array.ap(fab.lefts, fa.lefts), fab.focus(fa.focus), A.array.ap(fab.rights, fa.rights)); }, | ||
extend: extend, | ||
extend: function (fa, f) { | ||
var lefts = fa.lefts.map(function (a, i) { | ||
return f(make(pipeable_1.pipe(fa.lefts, A.takeLeft(i)), a, A.snoc(pipeable_1.pipe(fa.lefts, A.dropLeft(i + 1)), fa.focus).concat(fa.rights))); | ||
}); | ||
var rights = fa.rights.map(function (a, i) { | ||
return f(make(A.snoc(fa.lefts, fa.focus).concat(pipeable_1.pipe(fa.rights, A.takeLeft(i))), a, pipeable_1.pipe(fa.rights, A.dropLeft(i + 1)))); | ||
}); | ||
return make(lefts, f(fa), rights); | ||
}, | ||
extract: function (fa) { return fa.focus; }, | ||
@@ -261,4 +260,8 @@ reduce: function (fa, b, f) { return fa.rights.reduce(f, f(fa.lefts.reduce(f, b), fa.focus)); }, | ||
}; | ||
var _a = pipeable_1.pipeable(exports.zipper), ap = _a.ap, foldMap = _a.foldMap, map = _a.map, reduce = _a.reduce, reduceRight = _a.reduceRight; | ||
var _a = pipeable_1.pipeable(exports.zipper), ap = _a.ap, apFirst = _a.apFirst, apSecond = _a.apSecond, duplicate = _a.duplicate, extend = _a.extend, foldMap = _a.foldMap, map = _a.map, reduce = _a.reduce, reduceRight = _a.reduceRight; | ||
exports.ap = ap; | ||
exports.apFirst = apFirst; | ||
exports.apSecond = apSecond; | ||
exports.duplicate = duplicate; | ||
exports.extend = extend; | ||
exports.foldMap = foldMap; | ||
@@ -265,0 +268,0 @@ exports.map = map; |
{ | ||
"name": "fp-ts-contrib", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"description": "A community driven utility package for fp-ts", | ||
@@ -47,3 +47,3 @@ "files": [ | ||
"benchmark": "^2.1.4", | ||
"docs-ts": "^0.3.1", | ||
"docs-ts": "^0.3.4", | ||
"doctoc": "^1.4.0", | ||
@@ -50,0 +50,0 @@ "dtslint": "github:gcanti/dtslint", |
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
239589
9015