Tips for golfing in Underload Underload is a stack-based semi-functional tarpit created by ais523. I've recently been trying to golf in it, as it's a surprisingly elegant language.

What tips do you have for golfing in Underload? (One tip per answer)
"Dirty" Decrement

The functionally-pure way to decrement a Church numeral is to use the lambda calculus predecessor function:

\n.n(\p.\z.z($(pT))(pT))(\z.z0[whatever you define the predecessor of 0 to be])


Where 0 = \x.\y.y, T = \x.\y.x, and $ is the successor.

Rewritten in Underload, this is 28 bytes:

(!())~(!())~(!:(:)~*(*)*~)~^!


This is alright, but we can exploit some of Underload's useful properties, namely that :! and ()* do are no-ops. This means that, for a number n, :ⁿ!!()()*ⁿ (where cⁿ is c repeated n times) yields n-1. For example doing this for the Church numeral 3 yields this:

:::!!()()***


Removing no-op pairs, we get:

:*


Which is 2.

So this is the new and shorter predecessor operation:

:(:)~^(!!()())*~(*)~^*


This is 7 bytes shorter.