From 08091244221646d97e64c66b2ac22c9cecd8af5a Mon Sep 17 00:00:00 2001 From: wilfreddenton Date: Tue, 25 Feb 2020 00:15:50 +0000 Subject: [PATCH] add explicit return types --- lib/fold.js | 2 +- lib/index.js | 2 +- package.json | 2 +- src/index.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/fold.js b/lib/fold.js index 6419df7..446e57e 100644 --- a/lib/fold.js +++ b/lib/fold.js @@ -1,2 +1,2 @@ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fold=e():t.fold=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,u=n.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(r=u.next()).done;)i.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=u.return)&&n.call(u)}finally{if(o)throw o.error}}return i},o=this&&this.__spread||function(){for(var t=[],e=0;e = { step: (x: X, a: A) => X; initial: X; extract: (x: X) => type Fold = (run: (_: Fold_) => R) => R -const fold = (f: Fold, fa: Foldable) => +const fold = (f: Fold, fa: Foldable): B => f(({ step, initial, extract }) => extract(fa.reduce(step, initial))) -const id = (b: B) => b +const id = (b: B): B => b const sum: Fold = (run) => run({