@fp-ts/data
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.SafeEvalTypeId = exports.GenSafeEval = void 0; | ||
exports.SafeEvalTypeId = void 0; | ||
exports.execute = execute; | ||
@@ -30,2 +30,4 @@ exports.flatMap = flatMap; | ||
var _Context = /*#__PURE__*/require("@fp-ts/data/internal/Context"); | ||
var _Stack = /*#__PURE__*/require("@fp-ts/data/internal/Stack"); | ||
@@ -60,2 +62,6 @@ | ||
[Symbol.iterator]() { | ||
return new _Context.SingleShotGen(this); | ||
} | ||
} | ||
@@ -79,2 +85,6 @@ | ||
[Symbol.iterator]() { | ||
return new _Context.SingleShotGen(this); | ||
} | ||
} | ||
@@ -99,16 +109,6 @@ | ||
} | ||
/** @internal */ | ||
class GenSafeEval { | ||
constructor(computation) { | ||
this.computation = computation; | ||
this._A = variance; | ||
[Symbol.iterator]() { | ||
return new _Context.SingleShotGen(this); | ||
} | ||
*[Symbol.iterator]() { | ||
return yield this; | ||
} | ||
} | ||
@@ -118,3 +118,2 @@ /** @internal */ | ||
exports.GenSafeEval = GenSafeEval; | ||
const unit = /*#__PURE__*/new Succeed(_Function.constVoid); | ||
@@ -188,3 +187,3 @@ /** @internal */ | ||
return suspend(() => { | ||
const iterator = f(genAdapter); | ||
const iterator = f(); | ||
const state = iterator.next(); | ||
@@ -310,6 +309,4 @@ return runGen(state, iterator); | ||
} | ||
/** @internal */ | ||
function genAdapter(_) { | ||
return new GenSafeEval(_); | ||
} | ||
@@ -324,4 +321,4 @@ function runGen(state, iterator) { | ||
return runGen(next, iterator); | ||
})(state.value["computation"]); | ||
})(state.value); | ||
} | ||
//# sourceMappingURL=SafeEval.js.map |
{ | ||
"name": "@fp-ts/data", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -5,3 +5,2 @@ /** | ||
import type { LazyArg } from "@fp-ts/data/Function"; | ||
import * as SE from "@fp-ts/data/internal/SafeEval"; | ||
declare const TypeId: unique symbol; | ||
@@ -25,2 +24,3 @@ /** | ||
readonly _A: (_: never) => A; | ||
[Symbol.iterator](): Generator<SafeEval<A>, A>; | ||
} | ||
@@ -88,3 +88,3 @@ /** | ||
*/ | ||
export declare const gen: <Eff extends SE.GenSafeEval<any>, AEff>(f: (i: <A>(_: SafeEval<A>) => SE.GenSafeEval<A>) => Generator<Eff, AEff, any>) => SafeEval<AEff>; | ||
export declare const gen: <Eff extends SafeEval<any>, AEff>(f: () => Generator<Eff, AEff, any>) => SafeEval<AEff>; | ||
/** | ||
@@ -91,0 +91,0 @@ * Executes the computation represented by the specified `SafeEval`. |
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
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
Sorry, the diff of this file is not supported yet
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
2093432
40660