Hyperlinkv0.8.0-beta.28

Hyperlink

Hyperlink.ProvidedContexttypesrc/Hyperlink.ts:1188
ProvidedContext<T, Ctx>

Remove the requirement channel R from every Effect method in an impl shape — the per-method-precise result of provideContext. Mirrors Store.CatchWriteError, but subtracts the provided context Ctx from each method's requirement rather than catching an error — sound like Effect.provideContext (RExclude<R, Ctx>), so a requirement the context does not cover survives as a residual (and a later ImplOf assignment catches it) instead of being silently claimed never. A method (...a) => Effect<S, E, R>(...a) => Effect<S, E, Exclude<R, Ctx>>; a bare Effect<S, E, R>Effect<S, E, Exclude<R, Ctx>>; a Subscribable (a ref field's impl) and a Stream (a stream field's impl, or a group's live) pass through untouched; a nested method group recurses.

Source src/Hyperlink.ts:118813 lines
export type ProvidedContext<T, Ctx> = T extends Subscribable<infer A>
  ? Subscribable<A>
  : T extends Stream.Stream<infer A, infer E, infer R>
    ? Stream.Stream<A, E, R>
    : T extends (...args: infer Args) => Effect.Effect<infer S, infer E, infer R>
      ? (...args: Args) => Effect.Effect<S, E, Exclude<R, Ctx>>
      : T extends Effect.Effect<infer S, infer E, infer R>
        ? Effect.Effect<S, E, Exclude<R, Ctx>>
        : T extends (...args: ReadonlyArray<never>) => unknown
          ? T
          : T extends object
            ? { readonly [K in keyof T]: ProvidedContext<T[K], Ctx> }
            : T;
Referenced by 1 symbols