<Self, S extends Spec>(
tag: HyperlinkTag<Self, S>,
impl: ImplWithDefaultOverrides<S>
): ImplWithDefaultOverrides<S>
<Self, S extends Spec, R>(
tag: HyperlinkTag<Self, S>,
impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>
): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>Anchor a reusable impl to its contract at the definition site. Inline impls are already typed by
layer / serve; but the moment you hoist one to a const (to share it across the
local layer and a served entry, or across several serves) it loses that typing — the mistake then
surfaces far away at the serve call, with no autocomplete as you write it. Hyperlink.make(tag, impl)
infers the tag's spec and constrains impl to ImplWithDefaultOverrides, returning it typed.
Runtime identity.
const scoresImpl = Hyperlink.make(ScoresDb, { read: … }); // typed here — autocomplete + errors at the def
Hyperlink.layer(ScoresDb, scoresImpl); // local
Node.httpServer([Hyperlink.serve(ScoresDb, scoresImpl)]); // served — same impl, both typedexport function function make<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, impl: ImplWithDefaultOverrides<S>): ImplWithDefaultOverrides<S> (+1 overload)Anchor a reusable impl to its contract at the definition site. Inline impls are already typed by
layer / serve; but the moment you hoist one to a const (to share it across the
local layer and a served entry, or across several serves) it loses that typing — the mistake then
surfaces far away at the serve call, with no autocomplete as you write it. Hyperlink.make(tag, impl)
infers the tag's spec and constrains impl to
ImplWithDefaultOverrides
, returning it typed.
Runtime identity.
const scoresImpl = Hyperlink.make(ScoresDb, { read: … }); // typed here — autocomplete + errors at the def
Hyperlink.layer(ScoresDb, scoresImpl); // local
Node.httpServer([Hyperlink.serve(ScoresDb, scoresImpl)]); // served — same impl, both typed
make<function (type parameter) Self in make<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, impl: ImplWithDefaultOverrides<S>): ImplWithDefaultOverrides<S>Self, function (type parameter) S in make<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, impl: ImplWithDefaultOverrides<S>): ImplWithDefaultOverrides<S>S extends Spec>(
tag: HyperlinkTag<Self, S>(parameter) tag: {
description: string | undefined;
key: Identifier;
of: (this: void, self: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends …;
context: (self: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends { readonly _…;
use: (f: (service: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends { rea…;
useSync: (f: (service: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends { rea…;
Identifier: Identifier;
Service: Shape;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
tag: interface HyperlinkTag<Self, S extends Spec, Svc = Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<...> : S[K] extends DefaultMethod<...> ? F : S[K] extends { ...; } ? SuccessOf<...> : S[K] extends { ...; } ? Subscribable<...> : S[K] extends { ...; } ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }>>The type of a HyperService tag carrying spec S — what
Hyperlink.Tag
produces
(and what you extend). Lets a consumer write
<S extends Spec>(tag: HyperlinkTag<Self, S>) and read the spec through named types
(
specOf
/
groupOf
) instead of a Parameters<typeof specOf> workaround.
HyperlinkTag<function (type parameter) Self in make<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, impl: ImplWithDefaultOverrides<S>): ImplWithDefaultOverrides<S>Self, function (type parameter) S in make<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, impl: ImplWithDefaultOverrides<S>): ImplWithDefaultOverrides<S>S>,
impl: ImplWithDefaultOverrides<S>impl: type ImplWithDefaultOverrides<
S extends Spec
> = ImplOf<S> & Partial<DefaultsBag>
Impl for
layer
/
serve
: wire
ImplOf
plus optional overrides for
Spec
default
leaves and piped
defaults
bag keys (extra keys are
structural — Spec leaf values stay precise via excess-property checks on known keys
when inlined at the call site).
Overrides apply at the provide site only (local handle / co-located serve grant).
Clients always install Tag-baked Spec defaults + the piped bag — they do not see the
server's override. Use
Layer.updateService
for post-hoc local patches.
ImplWithDefaultOverrides<function (type parameter) S in make<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, impl: ImplWithDefaultOverrides<S>): ImplWithDefaultOverrides<S>S>,
): type ImplWithDefaultOverrides<
S extends Spec
> = ImplOf<S> & Partial<DefaultsBag>
Impl for
layer
/
serve
: wire
ImplOf
plus optional overrides for
Spec
default
leaves and piped
defaults
bag keys (extra keys are
structural — Spec leaf values stay precise via excess-property checks on known keys
when inlined at the call site).
Overrides apply at the provide site only (local handle / co-located serve grant).
Clients always install Tag-baked Spec defaults + the piped bag — they do not see the
server's override. Use
Layer.updateService
for post-hoc local patches.
ImplWithDefaultOverrides<function (type parameter) S in make<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, impl: ImplWithDefaultOverrides<S>): ImplWithDefaultOverrides<S>S>;
export function function make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R> (+1 overload)Anchor a reusable impl to its contract at the definition site. Inline impls are already typed by
layer / serve; but the moment you hoist one to a const (to share it across the
local layer and a served entry, or across several serves) it loses that typing — the mistake then
surfaces far away at the serve call, with no autocomplete as you write it. Hyperlink.make(tag, impl)
infers the tag's spec and constrains impl to
ImplWithDefaultOverrides
, returning it typed.
Runtime identity.
const scoresImpl = Hyperlink.make(ScoresDb, { read: … }); // typed here — autocomplete + errors at the def
Hyperlink.layer(ScoresDb, scoresImpl); // local
Node.httpServer([Hyperlink.serve(ScoresDb, scoresImpl)]); // served — same impl, both typed
make<function (type parameter) Self in make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>Self, function (type parameter) S in make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>S extends Spec, function (type parameter) R in make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>R>(
tag: HyperlinkTag<Self, S>(parameter) tag: {
description: string | undefined;
key: Identifier;
of: (this: void, self: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends …;
context: (self: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends { readonly _…;
use: (f: (service: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends { rea…;
useSync: (f: (service: Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<T, never, Self> : S[K] extends DefaultMethod<infer F> ? F : S[K] extends { rea…;
Identifier: Identifier;
Service: Shape;
stack: string | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
tag: interface HyperlinkTag<Self, S extends Spec, Svc = Simplify<{ readonly [K in keyof S]: S[K] extends FromLocalMethod<infer M> ? InjectLocal<M, Self> : S[K] extends LocalMethod<infer T> ? LocalEffect<...> : S[K] extends DefaultMethod<...> ? F : S[K] extends { ...; } ? SuccessOf<...> : S[K] extends { ...; } ? Subscribable<...> : S[K] extends { ...; } ? ClientMethod<...> : S[K] extends Spec ? Simplify<...> : never; }>>The type of a HyperService tag carrying spec S — what
Hyperlink.Tag
produces
(and what you extend). Lets a consumer write
<S extends Spec>(tag: HyperlinkTag<Self, S>) and read the spec through named types
(
specOf
/
groupOf
) instead of a Parameters<typeof specOf> workaround.
HyperlinkTag<function (type parameter) Self in make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>Self, function (type parameter) S in make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>S>,
impl: Effect.Effect<
ImplWithDefaultOverrides<S>,
never,
R
>
(parameter) impl: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
impl: import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<type ImplWithDefaultOverrides<
S extends Spec
> = ImplOf<S> & Partial<DefaultsBag>
Impl for
layer
/
serve
: wire
ImplOf
plus optional overrides for
Spec
default
leaves and piped
defaults
bag keys (extra keys are
structural — Spec leaf values stay precise via excess-property checks on known keys
when inlined at the call site).
Overrides apply at the provide site only (local handle / co-located serve grant).
Clients always install Tag-baked Spec defaults + the piped bag — they do not see the
server's override. Use
Layer.updateService
for post-hoc local patches.
ImplWithDefaultOverrides<function (type parameter) S in make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>S>, never, function (type parameter) R in make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>R>,
): import EffectEffect.interface Effect<out A, out E = never, out R = never>The Effect interface defines a value that lazily describes a workflow or
job. The workflow requires some context R, and may fail with an error of
type E, or succeed with a value of type A.
When to use
Use when you need to represent a lazy, composable workflow that can require
services, fail with a typed error, or succeed with a typed value.
Details
Effect values model resourceful interaction with the outside world,
including synchronous, asynchronous, concurrent, and parallel interaction.
They use a fiber-based concurrency model, with built-in support for
scheduling, fine-grained interruption, structured concurrency, and high
scalability.
To run an Effect value, you need a Runtime, which is a type that is
capable of executing Effect values.
Effect<type ImplWithDefaultOverrides<
S extends Spec
> = ImplOf<S> & Partial<DefaultsBag>
Impl for
layer
/
serve
: wire
ImplOf
plus optional overrides for
Spec
default
leaves and piped
defaults
bag keys (extra keys are
structural — Spec leaf values stay precise via excess-property checks on known keys
when inlined at the call site).
Overrides apply at the provide site only (local handle / co-located serve grant).
Clients always install Tag-baked Spec defaults + the piped bag — they do not see the
server's override. Use
Layer.updateService
for post-hoc local patches.
ImplWithDefaultOverrides<function (type parameter) S in make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>S>, never, function (type parameter) R in make<Self, S extends Spec, R>(tag: HyperlinkTag<Self, S>, impl: Effect.Effect<ImplWithDefaultOverrides<S>, never, R>): Effect.Effect<ImplWithDefaultOverrides<S>, never, R>R>;
export function function make<Self, S extends Spec>(tag: HyperlinkTag<Self, S>, impl: ImplWithDefaultOverrides<S>): ImplWithDefaultOverrides<S> (+1 overload)Anchor a reusable impl to its contract at the definition site. Inline impls are already typed by
layer / serve; but the moment you hoist one to a const (to share it across the
local layer and a served entry, or across several serves) it loses that typing — the mistake then
surfaces far away at the serve call, with no autocomplete as you write it. Hyperlink.make(tag, impl)
infers the tag's spec and constrains impl to
ImplWithDefaultOverrides
, returning it typed.
Runtime identity.
const scoresImpl = Hyperlink.make(ScoresDb, { read: … }); // typed here — autocomplete + errors at the def
Hyperlink.layer(ScoresDb, scoresImpl); // local
Node.httpServer([Hyperlink.serve(ScoresDb, scoresImpl)]); // served — same impl, both typed
make(_tag: unknown_tag: unknown, impl: unknownimpl: unknown): unknown {
return impl: unknownimpl;
}