Hyperlinkv0.8.0-beta.28

Hyperlink

Hyperlink.makefunctionsrc/Hyperlink.ts:1962
<Self, S extends Spec>(
  tag: HyperlinkTag<Self, S>,
  impl: ImplOf<S>
): ImplOf<S>
<Self, S extends Spec, R>(
  tag: HyperlinkTag<Self, S>,
  impl: Effect.Effect<ImplOf<S>, never, R>
): Effect.Effect<ImplOf<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 its ImplOf, 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
constructorsImplOf
Source src/Hyperlink.ts:196211 lines
export function make<Self, S extends Spec>(
  tag: HyperlinkTag<Self, S>,
  impl: ImplOf<S>,
): ImplOf<S>;
export function make<Self, S extends Spec, R>(
  tag: HyperlinkTag<Self, S>,
  impl: Effect.Effect<ImplOf<S>, never, R>,
): Effect.Effect<ImplOf<S>, never, R>;
export function make(_tag: unknown, impl: unknown): unknown {
  return impl;
}