Decompose problems into pipelines of data transformations. Refactors loops into map/filter/reduce chains, converts nested/OO logic into composable function sequences, designs multi-step data transformation pipelines. Trigger on: "transformational programming", "data pipeline", "function pipeline", "pipe operator", "|>", "stream processing", "chained transformations", "Unix pipes", "dataflow", "decompose into steps", "write this as a pipeline", "compose functions", "chain of transformations", or restructuring imperative/OO code into data transforms. NOT for ETL infrastructure or stream processing frameworks (Kafka, Flink) — focuses on code-level function composition and transformation design patterns.
94
97%
Does it follow best practices?
Impact
85%
1.19xAverage score across 3 eval scenarios
Passed
No known issues
| Language | Mechanism |
|---|---|
| Elixir | |> operator |
| F#, Elm, Swift | |> operator |
| Clojure | ->, ->> threading macros |
| R | %>% (magrittr) |
| Haskell | &, $, or custom operators |
| JavaScript | .map().filter().reduce(), node:stream pipelines |
| Python | Generator chaining, explicit assignment chains |
| Java | Stream API chaining |
| Rust | Iterator chains (.map().filter().collect()) |
| Any language | Explicit assignment: a = f(x); b = g(a); h(b) |
Instead of raw values, wrap results in a type that carries success or failure. Each step either transforms a success or passes through a failure.
| Language | Wrapper | Forwarding pattern |
|---|---|---|
| Haskell | Maybe a, Either e a | >>= (bind) |
| Rust | Result<T, E> | ? operator |
| Elixir | {:ok, val} | {:error, reason} | Pattern match: defp fn({:ok, data}), do: ... — second clause for error |
| Scala | Option, Either | map / flatMap |
| JavaScript | Promise | .then().catch() |
| Python | Custom Result type or returns lib | unwrap or early return check |
Fallback for languages without pattern matching — explicit check after each step:
def pipeline(input):
result = step_one(input)
if is_error(result):
return result
result = step_two(result)
if is_error(result):
return result
return step_three(result)