Talk:Tacit programming

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Untitled[edit]

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)[reply]


Perl?[edit]

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)[reply]

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)[reply]
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)[reply]

J example[edit]

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)[reply]

Misuse of category theory[edit]

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#Mathematical_view). 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: [1]. 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)[reply]

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 small categories . Currying relies upon the category and morphism induced by a morphism from a direct product of Cartesian closed categories to category . The existence of should be obvious. By hypothesis exists, and thus a homomorphism is induced between the two direct products. This applies to currying because the small set exponential category (somewhat analogous to the power set) corresponds to the space of functions . 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 . I'm going to remove the citation request, though.

Use of dot operator (function composition) in first example is wrong.[edit]

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)[reply]

No, you are dead wrong too. It's clear as day: f (g x), when applied to y, does not "miraculously" become f (g x y) 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:
        (definition of function application)
        (definition of composition)
        (definition of function application)
        (using Haskell-like prefix notation for the composition operator)
        (definition of composition)
Hence the original answer to the problem whose author mistakenly wrote ((.) f) as (f .), which is frankly understandable. 195.132.60.60 (talk) 21:36, 20 August 2015 (UTC)[reply]
((.) f) and (f .) are the same thing.
, 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)[reply]