-
-
Notifications
You must be signed in to change notification settings - Fork 140
"Building pipelines" documentation should mention flow #1255
Copy link
Copy link
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
What is the type of issue?
No response
What is the issue?
The pipelines documentation is decent, but I immediately started to think about how I could combine operations. Like: let's say I take the documentation example of
import { pipe } from "effect"
// Define simple arithmetic operations
const increment = (x: number) => x + 1
const double = (x: number) => x * 2
const subtractTen = (x: number) => x - 10
// Sequentially apply these operations using `pipe`
const result = pipe(5, increment, double, subtractTen)
console.log(result)
// Output: 2And I want to create a method that's like incrementDoubleAndSubtractTen.
The naive implementation would be
const incrementDoubleAndSubtractTen = pipe(increment, double, subtractTen)But this doesn't typecheck. The correct solution would be
const incrementDoubleAndSubtractTen = flow(increment, double, subtractTen)But the flow() method isn't mentioned in these docs or afaict anywhere else in the docs.
Where did you find it?
https://effect.website/docs/getting-started/building-pipelines/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation