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
A SaaS company receives customer feedback submissions through a web form. Each submission is a map containing a customer ID, a rating (integer 1–5), a comment (string), and a timestamp (ISO 8601 string). The data arrives as a list of raw maps from a database query. Before being stored in the analytics system, each submission needs to go through several transformation steps: parse and validate the timestamp, reject submissions with invalid ratings, normalize the comment text (trim whitespace, lowercase), and finally compute a per-rating breakdown showing how many submissions fall into each score bucket.
A backend engineer wants to implement this as a clean functional pipeline in Elixir. The input is a list of maps (each representing one submission). The output is a map of rating counts plus the count of rejected submissions.
There is no existing code. Design and implement the solution in Elixir.
Produce a file named feedback_pipeline.ex containing the full Elixir module and implementation. Also produce a file named pipeline_analysis.md documenting the transformation analysis: the data flow, step breakdown, implementation explanation, and how errors propagate through the pipeline.
The final output of the pipeline function should be a map like:
%{
processed: 87,
rejected: 5,
rating_counts: %{1 => 3, 2 => 10, 3 => 22, 4 => 31, 5 => 21}
}