I try formulate some lambda expression in lambda calculus. It is similar to a code, but I have to use align environment because it contains math symbols. I wonder how I can formulate its structures better? The current one has a lot of unneeded spaces in between, although it captures some of what I want it to look like.
\begin{align*}
\text{cell} = & \text{rec} (& \lambda b.&\lambda c. &\lambda m.& \\
& & \text{if} &(\text{get?}&(m), & \\
& & & \text{seq} &(\text{send}&(\text{contents}(m), c), & \text{ready}(b(c))), \\
& & & \text{if} &(\text{set?}&(m), & \\
& & & & \text{ready}&(b(\text{contents}(m))), & \\
& & & & \text{ready}&(b(c)))))
\end{align*}
Here is what I want
{align*}
with{alignat*}{3}
(I suppose you made the right calculation and have three alignment points).