>It is somewhat surprising that unification is cleaner and easier to implement in an loopy imperative mutational style than in a recursive functional pure style. Typically theorem proving / mathematical algorithms are much cleaner in the second style in my subjective opinion.<p>This is the Curry–Howard correspondence.<p>While it seems everyone wants to force individuals into one of the formal vs constructivist, it is best to have both in your toolbox.<p>Contex and personal preference and ability apply here, but in general it is easier for us mortals to use the constructivist approach when programming.<p>This is because, by simply choosing to not admit PEM a priori, programs become far more like constructive proofs.<p>If you look at the similarities between how Church approached the Entscheidungsproblem, the equivalence of TM and lambda calculus, the implications of Post's theorm and an assumption of PEM, it will be clear that the formalist approach demands much more of the programmer.<p>Functional programming grew out of those proofs-as-programs concepts, so if you prefer functional styles, the proofs are the program you write.<p>Obviously the above has an absurd amount of oversimplification, but I am curious what would have been different if one had started with more intuitional forms of Unification.<p>For me, I would have probably just moved to the formalist model to be honest like the author.<p>I just wanted to point out there is a real reason many people find writing algorithms in a functional/constructivist path.