1,904 karma · joined November 18, 2012
www.xuanji.li
[ my public key: https://keybase.io/xuanji; my proof: https://keybase.io/xuanji/sigs/YyOVzG7h-Ip1eEcZdfnsvWckOKvnM-6b09PfP3q-9Y0 ]
hi
That said, PEPs 517 and 518 sound like they're going in the right direction from the article.
Given these more precise definitions, the analogous theorem would be that there is no type system (or static analysis) for use-after-free which is both sound and complete.
https://mobile.twitter.com/yggtorrent_com?lang=en
There's also the option of buying DVDs on Amazon
C8 = function composition is the primary form of composition for functional programming.
Most people consider Haskell to be a language that heavily encourages a "functional programming" style. If you take a look at idiomatic Haskell code, yes, you see a lot of function composition. But I think you also see a lot of composition that are distinct from "simple" function composition:
- Parametric polymorphism
- 'Monadic' composition (i.e. `>=>`)
- Applying higher-order functions
Let C1 be the following claim: "function composition is better behaved than object composition and procedure composition".
Let C2 be the following claim: "the most important part of FP is function composition".
I'm saying that you've provided arguments for C1 (that I mostly agree with). So let's say that I agree with C1. However, you haven't shown why C1 => C2, and I disagree with C2.
So to answer your question, I understand your rationale for C1 (and I agree with it), but I don't understand your rationale for C2, or for why C1 => C2.
Like, I use what I think of as FP features much more than I do what I think of as OOP features. In languages commonly thought of as multi-paradigm, say python, I have lots of higher-order functions, and lots of functions which are just compositions of others (I don't write point-free style though). I try hard to avoid implementation inheritance ("OOP inheritance") if possible. I know people who do the exact opposite thing in python.
But if I write down the definition of "FP" for me and you write down your definition, I 99% guarantee you they'll be different in a substantive way.
So I agree with many of the points you make in the links about how composition works in (what you think of as) FP vs OOP. But I view that as claims about individual design patterns or language features (and very big, fundamental design patterns / language features), not as things called "FP" and "OOP".
Which one of your links define the terms "FP" and "OOP"?
However I think the claim "functional programming is about function composition", together with the claim that "other things commonly associated such as immutability are not defining features of functional programming", is a stronger claim that seems unsubstantiated. There are many design choices analogous to immutability vs mutability that people argue are defining features of or are not defining features of FP. A Lisper might argue that closures over first-class mutable data can be part of the FP paradigm, or even that an FP language must allow that, while a Haskeller might argue that no, this must be modelled on top of immutable data. I see merit in common arguments presented for both viewpoints. A Haskeller might argue that monadic composition and syntactic support for it is a defining feature of FP, because simulating it with only "plain" function composition is deficient in some way. A criticism of this might be that monad transformers don't compose well. They might argue functions that functions should not be strict by default, because non-strict functions compose better than functions which are not. There's a great Quora answer that talks about this (https://www.quora.com/After-Haskell-there-is-no-language-whi...) and I remember a blog post framing this more explicitly in terms of composition that I can't find right now. I'm just sketching arguments that I've heard/thought about, but all these arguments deal with composition, abstraction and functions.
I don't like the framing of "does a procedure or an object compose better" because not all design choices fall into one of those, in fact I think very few do in a useful way. Is multiple dynamic dispatch (e.g. Julia) a way to compose functions or objects?
Every cube is within one of a multiple of nine, which means every sum of three cubes is within three of a multiple of nine. So numbers of the form 9k+4 or 9k+5 cannot be expressed as the sum of three cubes.
It’s conjectured that every other whole number can be.
https://twitter.com/robinhouston/status/1169938974246342658?...