Haskell and OCaml are, by comparison, not very nested.
(defun f (x)
(let ((y x))
(setf y (* y x))
(block foo
(if (minusp y)
(return-from foo y))
(loop :for i :from 1 :to 10 :do
...
This is absolutely typical bog-standard left-to-right top-to-bottom structured programming type code. It also must be executed like so: - Define the function
- Bind the variable
- Mutate the variable
- Set up a named block
- Do a conditional return
- Run a loop
- ...
The order of execution literally matches the order it's written. But not unlike almost all other languages on the planet, expressions are evaluated inside-out.Haskell's whole raison d'etre is to allow arbitrary nesting and substitution of terms, and all or none of these terms may or may not be evaluated depending on need. De-nesting happens with a copious number of syntax to bind names to values, sometimes before the expression (via let), sometimes after the expression (via where), and sometimes in the middle of an expression (via do).
Programs are rarely linear; why do you expect code to be?