3 ms·
Also check out the mathematical definition of function composition. Note how there are type signatures. Function composition defined without types is incomplete
by crimsonalucard 7y ago
Also check out the mathematical definition of function composition. Note how there are type signatures. Function composition defined without types is incomplete.
https://www.wikiwand.com/en/Function_composition https://www.wikiwand.com/en/Function_composition
- yellowapple 7y agoSee the Scheme example in https://www.wikiwand.com/en/Function_composition_(computer_science) https://www.wikiwand.com/en/Function_composition_(computer_s.... Where, pray tell, are the type signatures? Come to think of it, where are the type signatures in the page you linked? You'll notice that said example is fundamentally equivalent to the pseudo-Forth one I provided (except that mine doesn't take an arbitrary number of functions/procedures to be composed, though it's perfectly feasible to just call "compose" repeatedly to accomplish the same thing).
- crimsonalucard 7y agoThe mathematical definition is canonical. It is the one that preserves context. The scheme definition is incomplete and allows for invalid compositions to occur. Forth is not composing anything. Remember that, it is imitating composition through a collection of primitive commands. Composition exists in a function as a primitive. Again no one is talking about isomorphism between procedural and functional languages. Composition exists as a primitive in functional, composition exists as a concept of multiple commands in forth or other procedural languages. Get it?