Talk:Tacit programming
![]() | Computer science Start‑class Mid‑importance | ||||||||||||||||
|
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)
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#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)
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.
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)