Flatten the left branch of Apply by changing the internal representation:
data Term = Apply Combinator [Term]
data Combinator = S | K
This is a nicer representation to work with because it's easier to determine whether or not a combinator is given enough arguments and an application can be performed.
Flatten the left branch of
Apply
by changing the internal representation:This is a nicer representation to work with because it's easier to determine whether or not a combinator is given enough arguments and an application can be performed.