Skip to content

Commit

Permalink
Release version 14.0.0
Browse files Browse the repository at this point in the history
- #457 TypeScript type inference for the `map` function was improved.
- #457 The TypeScript type for `map` has been narrowed, and might
  now cause a compile error.
  • Loading branch information
Avaq committed Mar 13, 2021
1 parent 55e16f5 commit e69901f
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 84 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ single files that come with all of Fluture's dependencies pre-bundled.
- [Fluture Module Minified][]: A minified EcmaScript module without TypeScript
typings. Not recommended for Deno.

[Fluture Script]: https://cdn.jsdelivr.net/gh/fluture-js/Fluture@13.0.1/dist/bundle.js
[Fluture Script Minified]: https://cdn.jsdelivr.net/gh/fluture-js/Fluture@13.0.1/dist/bundle.min.js
[Fluture Module]: https://cdn.jsdelivr.net/gh/fluture-js/Fluture@13.0.1/dist/module.js
[Fluture Module Minified]: https://cdn.jsdelivr.net/gh/fluture-js/Fluture@13.0.1/dist/module.min.js
[Fluture Script]: https://cdn.jsdelivr.net/gh/fluture-js/Fluture@14.0.0/dist/bundle.js
[Fluture Script Minified]: https://cdn.jsdelivr.net/gh/fluture-js/Fluture@14.0.0/dist/bundle.min.js
[Fluture Module]: https://cdn.jsdelivr.net/gh/fluture-js/Fluture@14.0.0/dist/module.js
[Fluture Module Minified]: https://cdn.jsdelivr.net/gh/fluture-js/Fluture@14.0.0/dist/module.min.js

## Usage

Expand Down
70 changes: 31 additions & 39 deletions dist/bundle.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
/**
* Fluture bundled; version 13.0.1
* Fluture bundled; version 14.0.0
*/

var Fluture = (function () {
'use strict';

function createCommonjsModule(fn, basedir, module) {
return module = {
path: basedir,
exports: {},
require: function (path, base) {
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
}
}, fn(module, module.exports), module.exports;
}

function commonjsRequire () {
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
function createCommonjsModule(fn) {
var module = { exports: {} };
return fn(module, module.exports), module.exports;
}

var sanctuaryTypeIdentifiers = createCommonjsModule(function (module) {
/*
@@@@@@@ @@@@@@@ @@
@@ @@ @@ @@ @@@
Expand All @@ -31,6 +21,8 @@ var Fluture = (function () {
@@ @@ @@ @@
@@@@@@@ @@@@@@@ @@@@@ @@
*/

var sanctuaryTypeIdentifiers = createCommonjsModule(function (module) {
//. # sanctuary-type-identifiers
//.
//. A type is a set of values. Boolean, for example, is the type comprising
Expand Down Expand Up @@ -207,7 +199,7 @@ var Fluture = (function () {
var name = 'Future';
var version = 5;

var $$type = namespace + '/' + name + '@' + version;
var $$type$1 = namespace + '/' + name + '@' + version;

function List(head, tail){
this.head = head;
Expand Down Expand Up @@ -519,7 +511,7 @@ var Fluture = (function () {
});
}

function showArg(x){
function showArg$1(x){
return sanctuaryShow(x) + ' :: ' + sanctuaryTypeIdentifiers.parse(sanctuaryTypeIdentifiers(x)).name;
}

Expand All @@ -534,7 +526,7 @@ var Fluture = (function () {
function invalidArgument(it, at, expected, actual){
return typeError(
it + '() expects its ' + ordinal[at] + ' argument to ' + expected + '.' +
'\n Actual: ' + showArg(actual)
'\n Actual: ' + showArg$1(actual)
);
}

Expand All @@ -553,7 +545,7 @@ var Fluture = (function () {
ordinal[i] ?
ordinal[i].charAt(0).toUpperCase() + ordinal[i].slice(1) :
'Argument ' + String(i + 1)
) + ': ' + showArg(arg);
) + ': ' + showArg$1(arg);
}).join('')
);
}
Expand Down Expand Up @@ -717,7 +709,7 @@ var Fluture = (function () {
return args;
}

function showArg$1(arg){
function showArg(arg){
return ' (' + sanctuaryShow(arg) + ')';
}

Expand All @@ -743,20 +735,20 @@ var Fluture = (function () {
}

function isFuture(x){
return x instanceof Future || sanctuaryTypeIdentifiers(x) === $$type;
return x instanceof Future || sanctuaryTypeIdentifiers(x) === $$type$1;
}

// Compliance with sanctuary-type-identifiers versions 1 and 2.
// To prevent sanctuary-type-identifiers version 3 from identifying 'Future'
// as being of the type denoted by $$type, we ensure that
// Future.constructor.prototype is equal to Future.
Future['@@type'] = $$type;
Future['@@type'] = $$type$1;
Future.constructor = {prototype: Future};

Future[FL.of] = resolve;
Future[FL.chainRec] = chainRec;

Future.prototype['@@type'] = $$type;
Future.prototype['@@type'] = $$type$1;

Future.prototype['@@show'] = function Future$show(){
return this.toString();
Expand Down Expand Up @@ -810,11 +802,11 @@ var Fluture = (function () {
Future.prototype.name = 'future';

Future.prototype.toString = function Future$toString(){
return this.name + getArgs(this).map(showArg$1).join('');
return this.name + getArgs(this).map(showArg).join('');
};

Future.prototype.toJSON = function Future$toJSON(){
return {$: $$type, kind: 'interpreter', type: this.name, args: getArgs(this)};
return {$: $$type$1, kind: 'interpreter', type: this.name, args: getArgs(this)};
};

function createInterpreter(arity, name, interpret){
Expand Down Expand Up @@ -1078,7 +1070,7 @@ var Fluture = (function () {

Transformer.prototype.toString = function Transformer$toString(){
return toArray(reverse(this.$2)).reduce(function(str, action){
return action.name + getArgs(action).map(showArg$1).join('') + ' (' + str + ')';
return action.name + getArgs(action).map(showArg).join('') + ' (' + str + ')';
}, this.$1.toString());
};

Expand All @@ -1093,7 +1085,7 @@ var Fluture = (function () {
}

function BaseTransformation$toJSON(){
return {$: $$type, kind: 'transformation', type: this.name, args: getArgs(this)};
return {$: $$type$1, kind: 'transformation', type: this.name, args: getArgs(this)};
}

var BaseTransformation = {
Expand Down Expand Up @@ -1193,13 +1185,13 @@ var Fluture = (function () {
return [this.$2];
};

function alwaysNever(_){
function alwaysNever$1(_){
return never;
}

function after(time){
var context1 = application1(after, positiveInteger, arguments);
return time === Infinity ? alwaysNever : (function after(value){
return time === Infinity ? alwaysNever$1 : (function after(value){
var context2 = application(2, after, any, arguments, context1);
return new After(context2, time, value);
});
Expand Down Expand Up @@ -1993,8 +1985,8 @@ var Fluture = (function () {

var emptyArray = resolve([]);

function parallel(max){
var context1 = application1(parallel, positiveInteger, arguments);
function parallel$1(max){
var context1 = application1(parallel$1, positiveInteger, arguments);
return function parallel(ms){
var context2 = application(2, parallel, futureArray, arguments, context1);
return ms.length === 0 ? emptyArray : new Parallel(context2, max, ms);
Expand Down Expand Up @@ -2023,14 +2015,14 @@ var Fluture = (function () {
return new ConcurrentFuture(sequential);
}

var $$type$1 = namespace + '/ConcurrentFuture@' + version;
var $$type = namespace + '/ConcurrentFuture@' + version;
var zeroInstance = new ConcurrentFuture(never);

// Compliance with sanctuary-type-identifiers versions 1 and 2.
// To prevent sanctuary-type-identifiers version 3 from identifying
// 'Par' as being of the type denoted by $$type, we ensure that
// Par.constructor.prototype is equal to Par.
Par['@@type'] = $$type$1;
Par['@@type'] = $$type;
Par.constructor = {prototype: Par};

Par[FL.of] = function Par$of(x){
Expand All @@ -2041,7 +2033,7 @@ var Fluture = (function () {
return zeroInstance;
};

Par.prototype['@@type'] = $$type$1;
Par.prototype['@@type'] = $$type;

Par.prototype['@@show'] = function Par$show(){
return this.toString();
Expand Down Expand Up @@ -2083,7 +2075,7 @@ var Fluture = (function () {
};

function isParallel(x){
return x instanceof ConcurrentFuture || sanctuaryTypeIdentifiers(x) === $$type$1;
return x instanceof ConcurrentFuture || sanctuaryTypeIdentifiers(x) === $$type;
}

function promise(m){
Expand All @@ -2103,22 +2095,22 @@ var Fluture = (function () {
return [this.$2];
};

function alwaysNever$1(_){
function alwaysNever(_){
return never;
}

function rejectAfter(time){
var context1 = application1(rejectAfter, positiveInteger, arguments);
return time === Infinity ? alwaysNever$1 : (function rejectAfter(value){
return time === Infinity ? alwaysNever : (function rejectAfter(value){
var context2 = application(2, rejectAfter, any, arguments, context1);
return new RejectAfter(context2, time, value);
});
}

var parallel$1 = {pred: isParallel, error: invalidArgumentOf('be a ConcurrentFuture')};
var parallel = {pred: isParallel, error: invalidArgumentOf('be a ConcurrentFuture')};

function seq(par){
application1(seq, parallel$1, arguments);
application1(seq, parallel, arguments);
return par.sequential;
}

Expand Down Expand Up @@ -2187,7 +2179,7 @@ var Fluture = (function () {
map: map,
node: node,
pap: pap,
parallel: parallel,
parallel: parallel$1,
Par: Par,
promise: promise,
race: race,
Expand Down

0 comments on commit e69901f

Please sign in to comment.