Talk:Tacit programming

Untitled
The stack-based example does not indicate wether it is in a pseudo-language or an existing one. I think it should (and preferably use an existing one). Nowhere man (talk) 10:15, 7 March 2010 (UTC)

Perl?
Does Perl count? You don't have to name function arguments in Perl, they all end up in the @_ array. I'll leave it to somebody else to consider. --68.32.37.109 (talk) 15:32, 15 March 2010 (UTC)


 * In my opinion Perl doesn't count because despite the fact that you don't have to name function parameters, nevertheless, they automatically get names (of the form $n where n is a number) and most programmers use them. If they don't use them, then they shift the parameters out of the @_ array into named variables, and that again is non-tacit. If you did all your programming without declaring any variables and used only shifts and similar functions to manipulate your parameters then and only then would you be using Perl in a tacit style. Dlw20070716 (talk) 08:28, 16 July 2015 (UTC)


 * Given the definition, "the definitions merely compose other functions," in my opinion not even shifting parameters is allowed. Oliver Gramberg (talk) 08:00, 17 October 2018 (UTC)

J example
The statement "In J one can see the same sort of point-free code" is false. The J relies heavily on verb trains and even the example is one - fork. Without this stated, example is totally confusing as monadic fork (+/ % #) x is translated to (+/ x) % (# x). In other words, it's total bullshit. —Preceding unsigned comment added by 62.245.111.133 (talk) 10:08, 29 March 2010 (UTC)

Misuse of category theory
The article currently makes the claim that currying is an example of a natural transformation of functors, specifically a Hom from some categories to some other categories. I suspect this is a misuse of category theory (see also the discussion on Currying). What we're dealing with here are *functions* from sets to sets, not *functors* from categories to categories. There is no reason that a function needs to be an object in a hom-set.

This change was made here: [//en.wikipedia.org/w/index.php?title=Tacit_programming&diff=282355363&oldid=281242356]. The author may be knowledgable in category theory, or may have just been overly excited that category theory might be relevant here. Or I could be wrong.

Leo C Stein (talk) 01:27, 29 November 2014 (UTC)

Functions are morphisms of the category of sets, which by definition corresponds to all small categories and by my recent enhancement of the  exponential object entry means for $$A,C$$ small categories $$C^A = \mathrm{Hom}(A,C)$$. Currying relies upon the category and morphism induced by a morphism from a direct product of Cartesian closed categories $$A\times B$$ to category $$C$$. The existence of $$\mathrm{Hom}(C^A \times B,C)$$ should be obvious. By hypothesis $$\mathrm{Hom}(A\times B, C)$$ exists, and thus a homomorphism is induced between the two direct products. This applies to currying because the small set exponential category $$C^A$$ (somewhat analogous to the power set) corresponds to the space of functions $$f:A\to C$$. This is a universal object induced by the morphism in question that encompasses currying on even uncountable sets; but just in case I'm going to change the expression to the less specific $$\mathrm{Hom}(A\times B, C) \cong \mathrm{Hom}(B,C^A)$$. I'm going to remove the citation request, though.

Use of dot operator (function composition) in first example is wrong.
p x y z = f (g x y) z

is expressed in point-free notation as:

p = f. g

not as

p = (f .). g

This can be seen by recalling the lambda expression for composition (.):

\f \g \x f (g x)

A partial application of f to the composition operator (f .) results in

(\B \C f (B C)) (bound variables renamed to avoid confusion.)

Substituting this back into (f .). g we get

(\B \C f (B C)). g

and substituting into the lambda expression of composition once again, we get

\A (\B \C f (B C)) (g A) (the remaining bound variable is once again renamed.)

As you can plainly see, function g does not get the first two parameters of this lambda expression as it should, instead it gets only one parameter. The result of function g should also be the first parameter of function f, and this is also not so in this lambda.

Now let's look at p = f. g as a lambda expression:

\A f (g A) (one bound variable remaining after substitution of f and g.)

Applying this to three parameters x y z, we see that the lambda expression will consume the first parameter (x) and properly give it to function g. The arity of g, however, requires an additional parameter, so it will also consume y. The arity of function f also requires an additional parameter, so it will consume z in addition to the result of function g.

Miraculously, the filter. map example appears to be correct. Dlw20070716 (talk) 07:59, 16 July 2015 (UTC)


 * No, you are dead wrong too. It's clear as day:, when applied to  , does not "miraculously" become   as you meant by "The arity of g, however, requires an additional parameter, so it will also consume y". Here's the correct reasoning, with a kind of lambda calculus notation:
 * $$\lambda x.\lambda y.\lambda z. f \ (g \ x \ y) \ z$$
 * $$= \lambda x.\lambda y.f \ (g \ x \ y)$$       (definition of function application)
 * $$= \lambda x.\lambda y.(f \circ (g \ x)) \ y$$       (definition of composition)
 * $$= \lambda x.f \circ (g \ x)$$       (definition of function application)
 * $$= \lambda x.((\circ) \ f) (g \ x)$$       (using Haskell-like prefix notation for the composition operator)
 * $$= ((\circ) \ f) \circ g$$       (definition of composition)
 * Hence the original answer to the problem whose author mistakenly wrote  as , which is frankly understandable. 195.132.60.60 (talk) 21:36, 20 August 2015 (UTC)
 * and  are the same thing.
 * $$((\circ) \ f) \circ g = (\circ)((\circ) \ f) g $$, are the same too.
 * This thing looks very complicated and unpractical. Just written as an exercise.
 * Thanks for these clarifications. I believe the page would benefit if your line-by-line explanations were included there! Oliver Gramberg (talk) 07:55, 17 October 2018 (UTC)