Layer.Layer<any, any, any>Contribution Layer: stamped WorkPool.kind → card + detail (append). Merge with platform skins + View.base, then View.react.
export const const layer: Layer.Layer<any, any, any>const layer: {
build: (memoMap: MemoMap, scope: Scope.Scope) => Effect<Context.Context<any>, any, any>;
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; <…;
}
Contribution Layer: stamped
WorkPool.kind
→ card + detail (append).
Merge with platform skins +
View.base
, then
View.react
.
layer = import LayerLayer.const mergeAll: <
Layers extends [
Layer<never, any, any>,
...Array<Layer<never, any, any>>
]
>(
...layers: Layers
) => Layer<
Success<Layers[number]>,
Error<Layers[number]>,
Services<Layers[number]>
>
Combines all the provided layers concurrently, creating a new layer with
merged input, error, and output types.
When to use
Use when you need to combine multiple independent layers.
Details
All layers are built concurrently, and their outputs are merged into a single layer.
If multiple merged layers depend on the same layer value, that dependency is
shared by default. Reuse a named layer value when you want services to share
the same resource, such as one database pool.
Example (Merging independent layers)
import { Context, Effect, Layer } from "effect"
class Database extends Context.Service<Database, {
readonly query: (sql: string) => Effect.Effect<string>
}>()("Database") {}
class Logger extends Context.Service<Logger, {
readonly log: (msg: string) => Effect.Effect<void>
}>()("Logger") {}
const dbLayer = Layer.succeed(Database, {
query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
})
const loggerLayer = Layer.succeed(Logger, {
log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
})
const mergedLayer = Layer.mergeAll(dbLayer, loggerLayer)
mergeAll(
import ViewView.const bind: <PoolCard>(stampedKind: string, view: ViewService<PoolCard>) => ContribLayer<PoolCard> (+1 overload)bind(import WorkPoolWorkPool.const kind: "hyperlink-ts/WorkPool"
export kind
The WorkPool resource kind — the single source of truth, re-exported publicly as
WorkPool.kind. It lives in its own leaf module so both the light WorkPool.Tag path
and the engine (which stamps it onto every definition) import the one value without the
Tag path dragging in the engine. Hyperlink / the dashboard match on it; there is no
second short discriminator.
kind, class PoolCardDefault WorkPool card View service.
PoolCard),
import ViewView.const bind: <PoolDetail>(stampedKind: string, view: ViewService<PoolDetail>) => ContribLayer<PoolDetail> (+1 overload)bind(import WorkPoolWorkPool.const kind: "hyperlink-ts/WorkPool"
export kind
The WorkPool resource kind — the single source of truth, re-exported publicly as
WorkPool.kind. It lives in its own leaf module so both the light WorkPool.Tag path
and the engine (which stamps it onto every definition) import the one value without the
Tag path dragging in the engine. Hyperlink / the dashboard match on it; there is no
second short discriminator.
kind, class PoolDetailDefault WorkPool detail View service.
PoolDetail),
);