Open mw10013 opened 11 months ago
// Effect.ts
import * as core from "./internal/core.js"
export const succeed: <A>(value: A) => Effect<never, never, A> = core.succeed
// internal/core.ts
export const succeed = <A>(value: A): Effect.Effect<never, never, A> => {
const effect = new EffectPrimitiveSuccess(OpCodes.OP_SUCCESS) as any
effect.i0 = value
return effect
}
class EffectPrimitiveSuccess {
public i0 = undefined
public i1 = undefined
public i2 = undefined
public trace = undefined;
[EffectTypeId] = effectVariance
constructor(readonly _op: Primitive["_op"]) {
// @ts-expect-error
this._tag = _op
}
[Equal.symbol](this: {}, that: unknown) {
return this === that
}
[Hash.symbol](this: {}) {
return Hash.random(this)
}
get value() {
return this.i0
}
pipe() {
return pipeArguments(this, arguments)
}
toJSON() {
return {
_id: "Exit",
_tag: this._op,
value: toJSON(this.value)
}
}
toString() {
return toString(this.toJSON())
}
[NodeInspectSymbol]() {
return this.toJSON()
}
}