Skip to content

pipe

pipe<A>(a): A

Defined in: Composition/pipe.ts:39

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

A

A

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B>(a, ab): B

Defined in: Composition/pipe.ts:40

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

A

(a) => B

B

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B, C>(a, ab, bc): C

Defined in: Composition/pipe.ts:41

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

C

A

(a) => B

(b) => C

C

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B, C, D>(a, ab, bc, cd): D

Defined in: Composition/pipe.ts:42

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

C

D

A

(a) => B

(b) => C

(c) => D

D

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B, C, D, E>(a, ab, bc, cd, de): E

Defined in: Composition/pipe.ts:48

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

C

D

E

A

(a) => B

(b) => C

(c) => D

(d) => E

E

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B, C, D, E, F>(a, ab, bc, cd, de, ef): F

Defined in: Composition/pipe.ts:55

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

C

D

E

F

A

(a) => B

(b) => C

(c) => D

(d) => E

(e) => F

F

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B, C, D, E, F, G>(a, ab, bc, cd, de, ef, fg): G

Defined in: Composition/pipe.ts:63

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

C

D

E

F

G

A

(a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

G

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B, C, D, E, F, G, H>(a, ab, bc, cd, de, ef, fg, gh): H

Defined in: Composition/pipe.ts:72

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

C

D

E

F

G

H

A

(a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

(g) => H

H

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B, C, D, E, F, G, H, I>(a, ab, bc, cd, de, ef, fg, gh, hi): I

Defined in: Composition/pipe.ts:82

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

C

D

E

F

G

H

I

A

(a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

(g) => H

(h) => I

I

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B, C, D, E, F, G, H, I, J>(a, ab, bc, cd, de, ef, fg, gh, hi, ij): J

Defined in: Composition/pipe.ts:93

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

C

D

E

F

G

H

I

J

A

(a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

(g) => H

(h) => I

(i) => J

J

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value

pipe<A, B, C, D, E, F, G, H, I, J, K>(a, ab, bc, cd, de, ef, fg, gh, hi, ij, jk): K

Defined in: Composition/pipe.ts:105

Pipes a value through a series of functions from left to right. Each function receives the output of the previous function.

pipe is the primary way to compose operations in this library. It makes code read top-to-bottom, left-to-right, which is more intuitive for developers coming from imperative backgrounds.

Fully typed for up to 10 steps. Beyond that TypeScript raises a compile error — split into named intermediate functions or use a cast.

A

B

C

D

E

F

G

H

I

J

K

A

(a) => B

(b) => C

(c) => D

(d) => E

(e) => F

(f) => G

(g) => H

(h) => I

(i) => J

(j) => K

K

// Basic usage
const result = pipe(
  5,
  n => n * 2,
  n => n + 1
); // 11

// With library functions
const greeting = pipe(
  Maybe.some("Alice"),
  Maybe.map(name => name.toUpperCase()),
  Maybe.map(name => `Hello, ${name}!`),
  Maybe.getOrElse("Hello!")
); // "Hello, ALICE!"

// Error handling with Result
const result = pipe(
  Result.tryCatch(() => JSON.parse(input), e => "Invalid JSON"),
  Result.map(data => data.value),
  Result.getOrElse(null)
);

flow for creating reusable pipelines without an initial value