MCPcopy Index your code
hub / github.com/Effect-TS/effect / fastPath

Function fastPath

packages/effect/src/internal/runtime.ts:243–265  ·  view source on GitHub ↗
(effect: Effect.Effect<A, E, R>)

Source from the content-addressed store, hash-verified

241export const isFiberFailure = (u: unknown): u is Runtime.FiberFailure => Predicate.hasProperty(u, FiberFailureId)
242
243const fastPath = <A, E, R>(effect: Effect.Effect<A, E, R>): Exit.Exit<A, E> | undefined => {
244 const op = effect as core.Primitive
245 switch (op._op) {
246 case "Failure":
247 case "Success": {
248 // @ts-expect-error
249 return op
250 }
251 case "Left": {
252 return core.exitFail(op.left)
253 }
254 case "Right": {
255 return core.exitSucceed(op.right)
256 }
257 case "Some": {
258 return core.exitSucceed(op.value)
259 }
260 case "None": {
261 // @ts-expect-error
262 return core.exitFail(new core.NoSuchElementException())
263 }
264 }
265}
266
267/** @internal */
268export const unsafeRunSyncExit: {

Callers 1

runtime.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…