The Haskell Substitution Stepper was created as a bachelor thesis at the Eastern Switzerland University of Applied Sciences (OST).
Have you ever seen a Haskell expression and asked yourself „what is this expression doing“? The Substitution Stepper is here to help you – whether you are a student trying to understand a function or an experienced programmer trying to fix a bug in your code.
You can define custom input expressions. The stepper then reduces those expressions step by step until head normal form. This way, you get to understand how the result of an expression is calculated. You can also work with custom types and type classes.
Here is an example. For the input expression length [1, 2, 3]
, the stepper shows the following reduction steps:
length [1, 2, 3]
= 1 + (length [2, 3])
= 1 + (1 + (length [3]))
= 1 + (1 + (1 + (length [])))
= 1 + (1 + (1 + 0))
= 1 + (1 + 1)
= 1 + 2
= 3
Do you want to work with your own expressions? Click here for the installation guide