Comparing version
@@ -20,3 +20,3 @@ "use strict"; | ||
var jabz_1 = require("@funkia/jabz"); | ||
var Freer = (function (_super) { | ||
var Freer = /** @class */ (function (_super) { | ||
__extends(Freer, _super); | ||
@@ -32,7 +32,7 @@ function Freer() { | ||
}; | ||
Freer.multi = false; | ||
return Freer; | ||
}(jabz_1.AbstractMonad)); | ||
Freer.multi = false; | ||
exports.Freer = Freer; | ||
var Pure = Pure_1 = (function (_super) { | ||
var Pure = /** @class */ (function (_super) { | ||
__extends(Pure, _super); | ||
@@ -44,2 +44,3 @@ function Pure(a) { | ||
} | ||
Pure_1 = Pure; | ||
Pure.prototype.match = function (m) { | ||
@@ -54,7 +55,8 @@ return m.pure(this.a); | ||
}; | ||
Pure = Pure_1 = __decorate([ | ||
jabz_1.monad | ||
], Pure); | ||
return Pure; | ||
var Pure_1; | ||
}(Freer)); | ||
Pure = Pure_1 = __decorate([ | ||
jabz_1.monad | ||
], Pure); | ||
exports.Pure = Pure; | ||
@@ -64,3 +66,3 @@ function pure(a) { | ||
} | ||
var Bind = Bind_1 = (function (_super) { | ||
var Bind = /** @class */ (function (_super) { | ||
__extends(Bind, _super); | ||
@@ -73,2 +75,3 @@ function Bind(val, f) { | ||
} | ||
Bind_1 = Bind; | ||
Bind.prototype.match = function (m) { | ||
@@ -85,7 +88,8 @@ return m.bind(this.val, this.f); | ||
}; | ||
Bind = Bind_1 = __decorate([ | ||
jabz_1.monad | ||
], Bind); | ||
return Bind; | ||
var Bind_1; | ||
}(Freer)); | ||
Bind = Bind_1 = __decorate([ | ||
jabz_1.monad | ||
], Bind); | ||
exports.Bind = Bind; | ||
@@ -96,3 +100,2 @@ function liftF(fa) { | ||
exports.liftF = liftF; | ||
var Pure_1, Bind_1; | ||
//# sourceMappingURL=freer.js.map |
@@ -19,3 +19,3 @@ "use strict"; | ||
} | ||
var Call = (function () { | ||
var Call = /** @class */ (function () { | ||
function Call(fn, args) { | ||
@@ -29,3 +29,3 @@ this.fn = fn; | ||
exports.Call = Call; | ||
var CallP = (function () { | ||
var CallP = /** @class */ (function () { | ||
function CallP(fn, args) { | ||
@@ -39,3 +39,3 @@ this.fn = fn; | ||
exports.CallP = CallP; | ||
var ThrowE = (function () { | ||
var ThrowE = /** @class */ (function () { | ||
function ThrowE(error) { | ||
@@ -48,3 +48,3 @@ this.error = error; | ||
exports.ThrowE = ThrowE; | ||
var CatchE = (function () { | ||
var CatchE = /** @class */ (function () { | ||
function CatchE(handler, io) { | ||
@@ -51,0 +51,0 @@ this.handler = handler; |
{ | ||
"name": "@funkia/io", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A library that turns impure code pure.", | ||
@@ -42,25 +42,25 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@funkia/jabz": "0.0.21", | ||
"tslib": "^1.7.1" | ||
"@funkia/jabz": "0.0.23", | ||
"tslib": "^1.8.1" | ||
}, | ||
"devDependencies": { | ||
"@types/benchmark": "^1.0.30", | ||
"@types/chai": "^3.5.2", | ||
"@types/mocha": "^2.2.41", | ||
"@types/sinon": "^1.16.36", | ||
"@types/benchmark": "^1.0.31", | ||
"@types/chai": "^4.0.8", | ||
"@types/mocha": "^2.2.44", | ||
"@types/sinon": "^4.1.0", | ||
"benchmark": "^2.1.4", | ||
"browser-env": "^2.0.31", | ||
"browserify": "^14.3.0", | ||
"browserify-istanbul": "^2.0.0", | ||
"chai": "^3.5.0", | ||
"codecov": "^2.1.0", | ||
"mocha": "^3.3.0", | ||
"nyc": "^10.3.2", | ||
"sinon": "^2.2.0", | ||
"source-map-support": "^0.4.15", | ||
"ts-node": "^3.0.3", | ||
"tsify": "^3.0.1", | ||
"typescript": "^2.3.2", | ||
"browser-env": "^3.2.4", | ||
"browserify": "^14.5.0", | ||
"browserify-istanbul": "^3.0.1", | ||
"chai": "^4.1.2", | ||
"codecov": "^3.0.0", | ||
"mocha": "^4.0.1", | ||
"nyc": "^11.3.0", | ||
"sinon": "^4.1.3", | ||
"source-map-support": "^0.5.0", | ||
"ts-node": "^3.3.0", | ||
"tsify": "^3.0.4", | ||
"typescript": "^2.6.2", | ||
"watchify": "^3.9.0", | ||
"webpack": "^2.5.0", | ||
"webpack": "^3.10.0", | ||
"xyz": "2.1.0" | ||
@@ -67,0 +67,0 @@ }, |
@@ -7,2 +7,3 @@ <img align="right" src="https://avatars0.githubusercontent.com/u/21360882?v=3&s=200"> | ||
[](https://david-dm.org/funkia/io) | ||
[](https://badge.fury.io/js/%40funkia%2Fio) | ||
@@ -13,6 +14,7 @@ # IO | ||
`IO` is a structure for expressing imperative computations in a | ||
pure way. In a nutshell it gives us the convenience of imperative | ||
programming while preserving the properties of a purely functional | ||
programming. | ||
`IO` is a structure for expressing imperative computations in a pure | ||
way. In a nutshell it gives us the convenience of imperative | ||
programming while preserving some of the properties of a purely | ||
functional programming. Most notable code that uses IO can be tested | ||
in a purely declarative way without actually running side-effects. | ||
@@ -25,4 +27,12 @@ ## Table of contents | ||
# Installation | ||
## Features | ||
* Provides a declarative and pure way to express code with side-effects | ||
* Has a nice API for easily testing `IO` code without running side-effects | ||
* Ships with both CommonJS and ES2015 modules for tree-shaking | ||
* Is written in TypeScript so comes with full comprehensive type | ||
definitions | ||
## Installation | ||
IO can be installed from npm. The package ships with both | ||
@@ -39,6 +49,6 @@ CommonJS modules and ES6 modules | ||
Let's say we have a function `fire Missiles` that takes a number `n` and | ||
then fires `n` missiles. If fewer than `n` missiles are available then | ||
only that amount of missiles is fired. The function returns the amount | ||
of missiles that was successfully fired. | ||
Let's say we have a function `fireMissiles` that takes a number `n` | ||
and then fires `n` missiles. If fewer than `n` missiles are available | ||
then only that amount of missiles is fired. The function returns the | ||
amount of missiles that was successfully fired. | ||
@@ -45,0 +55,0 @@ ```typescript |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
281
3.69%43835
-36.71%19
-24%692
-38.43%1
Infinity%+ Added
- Removed
Updated
Updated