What category are Tagless Final Algebras final In? The Haskell and Scala community have been very enamored recently with what they call tagless final 'pattern' of programming. These are referenced as dual to initial free algebras, so I was wondering what Tagless Final was final of. On ncatlab one only finds talk of final coalgebras, not final algebras. 

A few references:


The influential Haskell Typed Tagless Final Interpreters lecture notes
A translation of that article for Scala (Dotty) Revisiting Tagless Final Interpreters
A blog post From Object Algebras to Finally Tagless Interpreters makes the case that Object algebras are equivalent to Tagless Final.
It cites the paper Extensibility for the Masses, practical extensibility with Object Algebras.


The example used by these are clearly Algebras, which in category theory are expressed with endofunctors F as maps of the form F(X) -&gt; X. Coalgebras are dual maps X -&gt; F(X), and represent processes.

The follow up question is more about use of final tagless in programming circles which seems to be more related to final coalgebras. 
See the question on stackoverflow here.
Final Algebra semantics was introduced by Mitch Wand in his paper "Final Algebra Semantics and Data Type Extensions", see this freely available tech report: https://www.cs.indiana.edu/ftp/techreports/TR65.pdf .

It does not mean final coalgebra semantics, which is a very different idea. The wrinkle is that the algebra is not final in the same category that the initial algebra is initial, because then the final algebra would just be given by the unit type/terminal object as carrier. Instead, Wand defines a category of adequate extensions of an algebra, which basically say you want the algebras in question to not equate basic values. An example of this is that the signature may contain numbers and you only want to consider algebras where the interpretations of distinct integers are unequal. This rules out the trivial terminal object as carrier because it would equate all numbers. I wrote a blog post about this a while ago in an attempt to understand the same question: http://prl.ccs.neu.edu/blog/2017/09/27/final-algebra-semantics-is-observational-equivalence/ .