fp-ts-contrib
Advanced tools
Comparing version 0.1.16 to 0.1.17
@@ -16,2 +16,7 @@ # Changelog | ||
# 0.1.17 | ||
- **New Feature** | ||
- add `FunctorWithIndex` instance to `Zipper`, #65 (@giogonzo) | ||
# 0.1.16 | ||
@@ -18,0 +23,0 @@ |
@@ -24,2 +24,3 @@ /** | ||
import { Traversable1 } from "fp-ts/es6/Traversable"; | ||
import { FunctorWithIndex1 } from "fp-ts/es6/FunctorWithIndex"; | ||
declare module "fp-ts/es6/HKT" { | ||
@@ -160,3 +161,4 @@ interface URItoKind<A> { | ||
Traversable1<URI> & | ||
Comonad1<URI>; | ||
Comonad1<URI> & | ||
FunctorWithIndex1<URI, number>; | ||
declare const ap: <A>( | ||
@@ -167,8 +169,11 @@ fa: 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>, | ||
duplicate: <A>(wa: Zipper<A>) => Zipper<Zipper<A>>, | ||
extend: <A, B>(f: (wa: Zipper<A>) => B) => (wa: Zipper<A>) => Zipper<B>, | ||
foldMap: <M>(M: Monoid<M>) => <A>(f: (a: A) => M) => (fa: Zipper<A>) => M, | ||
map: <A, B>(f: (a: A) => B) => (fa: Zipper<A>) => Zipper<B>, | ||
reduce: <A, B>(b: B, f: (b: B, a: A) => B) => (fa: Zipper<A>) => B, | ||
reduceRight: <A, B>(b: B, f: (a: A, b: B) => B) => (fa: Zipper<A>) => B; | ||
reduceRight: <A, B>(b: B, f: (a: A, b: B) => B) => (fa: Zipper<A>) => B, | ||
mapWithIndex: <A, B>( | ||
f: (i: number, a: A) => B | ||
) => (fa: Zipper<A>) => Zipper<B>; | ||
export { | ||
@@ -210,3 +215,7 @@ /** | ||
*/ | ||
reduceRight | ||
reduceRight, | ||
/** | ||
* @since 0.1.17 | ||
*/ | ||
mapWithIndex | ||
}; |
@@ -233,5 +233,9 @@ var __assign = (this && this.__assign) || function () { | ||
traverse: traverse, | ||
sequence: sequence | ||
sequence: sequence, | ||
mapWithIndex: function (fa, f) { | ||
var l = fa.lefts.length; | ||
return make(fa.lefts.map(function (a, i) { return f(i, a); }), f(l, fa.focus), fa.rights.map(function (a, i) { return f(l + 1 + i, a); })); | ||
} | ||
}; | ||
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; | ||
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, mapWithIndex = _a.mapWithIndex; | ||
export { | ||
@@ -273,2 +277,6 @@ /** | ||
*/ | ||
reduceRight }; | ||
reduceRight, | ||
/** | ||
* @since 0.1.17 | ||
*/ | ||
mapWithIndex }; |
@@ -24,2 +24,3 @@ /** | ||
import { Traversable1 } from "fp-ts/lib/Traversable"; | ||
import { FunctorWithIndex1 } from "fp-ts/lib/FunctorWithIndex"; | ||
declare module "fp-ts/lib/HKT" { | ||
@@ -160,3 +161,4 @@ interface URItoKind<A> { | ||
Traversable1<URI> & | ||
Comonad1<URI>; | ||
Comonad1<URI> & | ||
FunctorWithIndex1<URI, number>; | ||
declare const ap: <A>( | ||
@@ -167,8 +169,11 @@ fa: 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>, | ||
duplicate: <A>(wa: Zipper<A>) => Zipper<Zipper<A>>, | ||
extend: <A, B>(f: (wa: Zipper<A>) => B) => (wa: Zipper<A>) => Zipper<B>, | ||
foldMap: <M>(M: Monoid<M>) => <A>(f: (a: A) => M) => (fa: Zipper<A>) => M, | ||
map: <A, B>(f: (a: A) => B) => (fa: Zipper<A>) => Zipper<B>, | ||
reduce: <A, B>(b: B, f: (b: B, a: A) => B) => (fa: Zipper<A>) => B, | ||
reduceRight: <A, B>(b: B, f: (a: A, b: B) => B) => (fa: Zipper<A>) => B; | ||
reduceRight: <A, B>(b: B, f: (a: A, b: B) => B) => (fa: Zipper<A>) => B, | ||
mapWithIndex: <A, B>( | ||
f: (i: number, a: A) => B | ||
) => (fa: Zipper<A>) => Zipper<B>; | ||
export { | ||
@@ -210,3 +215,7 @@ /** | ||
*/ | ||
reduceRight | ||
reduceRight, | ||
/** | ||
* @since 0.1.17 | ||
*/ | ||
mapWithIndex | ||
}; |
@@ -256,5 +256,9 @@ "use strict"; | ||
traverse: traverse, | ||
sequence: sequence | ||
sequence: sequence, | ||
mapWithIndex: function (fa, f) { | ||
var l = fa.lefts.length; | ||
return make(fa.lefts.map(function (a, i) { return f(i, a); }), f(l, fa.focus), fa.rights.map(function (a, i) { return f(l + 1 + i, a); })); | ||
} | ||
}; | ||
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; | ||
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, mapWithIndex = _a.mapWithIndex; | ||
exports.ap = ap; | ||
@@ -269,1 +273,2 @@ exports.apFirst = apFirst; | ||
exports.reduceRight = reduceRight; | ||
exports.mapWithIndex = mapWithIndex; |
{ | ||
"name": "fp-ts-contrib", | ||
"version": "0.1.16", | ||
"version": "0.1.17", | ||
"description": "A community driven utility package for fp-ts", | ||
@@ -5,0 +5,0 @@ "files": [ |
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
279240
10828