const summary = railway(
rawId,
parseWith(IdSchema, toError).as("id"),
fromPromiseNamed("row", ({ id }) => db.profiles.findFirst({ where: eq(profiles.id, id) }), toError),
requireNamed("profile", "row", ({ id }) => ({ kind: "not_found" as const, id })),
deriveNamed("normalized", ({ profile }) => normalizeProfile(profile)),
select(({ normalized }) => toProfileSummary(normalized)),
);
Functional companion to Railway — point-free composition of
reusable workflow steps. Starts from Railway.context({ input }) and
applies each step in order. Step factories live below: parseWith,
fromSyncNamed, fromResultNamed, fromPromiseNamed,
fromAsyncNamed, deriveNamed, requireNamed,
parallelNamed, select.
const summary = railway(
rawId,
parseWith(IdSchema, toError).as("id"),
fromPromiseNamed("row", ({ id }) => db.profiles.findFirst({ where: eq(profiles.id, id) }), toError),
requireNamed("profile", "row", ({ id }) => ({ kind: "not_found" as const, id })),
deriveNamed("normalized", ({ profile }) => normalizeProfile(profile)),
select(({ normalized }) => toProfileSummary(normalized)),
);
Functional companion to Railway — point-free composition of
reusable workflow steps. Starts from Railway.context({ input }) and
applies each step in order. Step factories live below: parseWith,
fromSyncNamed, fromResultNamed, fromPromiseNamed,
fromAsyncNamed, deriveNamed, requireNamed,
parallelNamed, select.
const summary = railway(
rawId,
parseWith(IdSchema, toError).as("id"),
fromPromiseNamed("row", ({ id }) => db.profiles.findFirst({ where: eq(profiles.id, id) }), toError),
requireNamed("profile", "row", ({ id }) => ({ kind: "not_found" as const, id })),
deriveNamed("normalized", ({ profile }) => normalizeProfile(profile)),
select(({ normalized }) => toProfileSummary(normalized)),
);
Functional companion to Railway — point-free composition of
reusable workflow steps. Starts from Railway.context({ input }) and
applies each step in order. Step factories live below: parseWith,
fromSyncNamed, fromResultNamed, fromPromiseNamed,
fromAsyncNamed, deriveNamed, requireNamed,
parallelNamed, select.
const summary = railway(
rawId,
parseWith(IdSchema, toError).as("id"),
fromPromiseNamed("row", ({ id }) => db.profiles.findFirst({ where: eq(profiles.id, id) }), toError),
requireNamed("profile", "row", ({ id }) => ({ kind: "not_found" as const, id })),
deriveNamed("normalized", ({ profile }) => normalizeProfile(profile)),
select(({ normalized }) => toProfileSummary(normalized)),
);
Functional companion to Railway — point-free composition of
reusable workflow steps. Starts from Railway.context({ input }) and
applies each step in order. Step factories live below: parseWith,
fromSyncNamed, fromResultNamed, fromPromiseNamed,
fromAsyncNamed, deriveNamed, requireNamed,
parallelNamed, select.
const summary = railway(
rawId,
parseWith(IdSchema, toError).as("id"),
fromPromiseNamed("row", ({ id }) => db.profiles.findFirst({ where: eq(profiles.id, id) }), toError),
requireNamed("profile", "row", ({ id }) => ({ kind: "not_found" as const, id })),
deriveNamed("normalized", ({ profile }) => normalizeProfile(profile)),
select(({ normalized }) => toProfileSummary(normalized)),
);
Functional companion to Railway — point-free composition of
reusable workflow steps. Starts from Railway.context({ input }) and
applies each step in order. Step factories live below: parseWith,
fromSyncNamed, fromResultNamed, fromPromiseNamed,
fromAsyncNamed, deriveNamed, requireNamed,
parallelNamed, select.
const summary = railway(
rawId,
parseWith(IdSchema, toError).as("id"),
fromPromiseNamed("row", ({ id }) => db.profiles.findFirst({ where: eq(profiles.id, id) }), toError),
requireNamed("profile", "row", ({ id }) => ({ kind: "not_found" as const, id })),
deriveNamed("normalized", ({ profile }) => normalizeProfile(profile)),
select(({ normalized }) => toProfileSummary(normalized)),
);
Functional companion to Railway — point-free composition of
reusable workflow steps. Starts from Railway.context({ input }) and
applies each step in order. Step factories live below: parseWith,
fromSyncNamed, fromResultNamed, fromPromiseNamed,
fromAsyncNamed, deriveNamed, requireNamed,
parallelNamed, select.
const summary = railway(
rawId,
parseWith(IdSchema, toError).as("id"),
fromPromiseNamed("row", ({ id }) => db.profiles.findFirst({ where: eq(profiles.id, id) }), toError),
requireNamed("profile", "row", ({ id }) => ({ kind: "not_found" as const, id })),
deriveNamed("normalized", ({ profile }) => normalizeProfile(profile)),
select(({ normalized }) => toProfileSummary(normalized)),
);
Functional companion to Railway — point-free composition of
reusable workflow steps. Starts from Railway.context({ input }) and
applies each step in order. Step factories live below: parseWith,
fromSyncNamed, fromResultNamed, fromPromiseNamed,
fromAsyncNamed, deriveNamed, requireNamed,
parallelNamed, select.
const summary = railway(
rawId,
parseWith(IdSchema, toError).as("id"),
fromPromiseNamed("row", ({ id }) => db.profiles.findFirst({ where: eq(profiles.id, id) }), toError),
requireNamed("profile", "row", ({ id }) => ({ kind: "not_found" as const, id })),
deriveNamed("normalized", ({ profile }) => normalizeProfile(profile)),
select(({ normalized }) => toProfileSummary(normalized)),
);
Functional companion to Railway — point-free composition of reusable workflow steps. Starts from
Railway.context({ input })and applies each step in order. Step factories live below: parseWith, fromSyncNamed, fromResultNamed, fromPromiseNamed, fromAsyncNamed, deriveNamed, requireNamed, parallelNamed, select.