Redex
A visual functional programming interpreter
Created on 24th October 2026
•
Redex
A visual functional programming interpreter
The problem Redex solves
Redex
Redex is a visual interpreter for a deliberately small Haskell-like functional language. It shows intermediate reductions, the progress of map, and the accumulator updates of foldl.
The interpreter implements a small-step, left-to-right, call-by-value evaluation strategy. Every Next Step performs at most one reduction: a variable substitution, arithmetic operation, function application, or an internal map/foldl transition. Previous Step replays the stored previous snapshot; Reset returns to the initial state. A 5,000-step limit guards against non-terminating programs.
This is an educational subset, not a full Haskell implementation. It does not currently implement division, booleans, conditionals, pattern matching, recursive let, algebraic data types or all Haskell syntax.
Challenges I ran into
One of the biggest hurdles was implementing genuine step-by-step evaluation while keeping the visualization synchronized with the interpreter. Initially, it was easier to make the UI display the expected output, but that wouldn't satisfy the goal of showing how a functional program actually executes.
We solved this by separating the interpreter from the React UI and defining a shared TypeScript interface between them. The interpreter now produces execution states after individual reductions, while the UI renders those states. We also had to ensure that Previous Step restored the exact earlier state, including the active list element and computed outputs, rather than just moving a progress indicator backward.
Testing edge cases such as empty lists, invalid expressions, and nested let, map, and foldl operations helped us catch issues beyond the basic demo. This taught us the importance of designing around the execution model first and treating the visualization as a reflection of actual computation, rather than simulating the computation through animations.
Tracks Applied (2)
Open Track - Development
Functional Programming Track
FP Launchpad
Technologies used
