TRAITS

pipe-immediate-curried-applications

When a function call returns a function that is immediately applied to a value, use pipe(value, fn(args)), never fn(args)(value). Inspect nested call expressions even across line breaks and inside yield*: use yield* pipe(decomposed, S.encodeEffect(schema)), not yield* S.encodeEffect(schema)(decomposed). This applies even to one transformation and when no data-first overload exists. It does not prohibit calling a previously stored function or using a genuine data-first overload such as Array.map(items, f).

Applies when
immediately applying the function returned by a curried call to a value.
File types
  • TypeScript
  • TSX
  • JavaScript
  • JSX
ID
ea63e22c-0673-4371-87e7-68a7e950fd1e
Source
.agents/traits/pipe-immediate-curried-applications-ea63e22c-0673-4371-87e7-68a7e950fd1e.md

Skipping this trait

Add this comment before any code to skip the trait for a whole file. A reason is required.

File header
// traits-ignore-file ea63e22c-0673-4371-87e7-68a7e950fd1e: <reason>