There doesn't need to be any unfairness here, FWIW. Well, OK, maybe if you want everyone to be part of the exact same MMORPG, but if that's not an issue (simple arena matches), why not have servers... all across the world? Including Hawaii? Each player just connects to the lowest latency server available to them to play with others connected to that server?
Doesn't that pretty much fix the problem?
foldl in Erlang is tail recursive automatically. foldr is not by default tail recursive in Erlang, Though I should mention foldr is tail recursive in languages like Haskell, and there are implementations of foldr in terms of foldl and visa versa. The conversions between foldr & foldl (depending on which is tail recursive) make explicit what needs to be done to move from non-tail recursive to tail recursive for recursions. Yet another reason you want to use those.
And as for can't follow. Your claim was about the messiness that these imperative artifacts remained and were worse. To avoid the messiness, you have to use the looping structures of functional programming Doing functional programming imperatively, of course is going to be messy. Doing functional programming functionally and you get the benefits.
Either all speech is protected or none of it is.
Let's see the same story, as published by the Squiggleslash Gazette:
Today Jimmy Wales, known for eating children, announced a new web site whose job will be collecting articles critical of the Trump administration, identifying journalists who are critics of the regime, so that Wales can go to their homes and murder them one by one.
There. That should satisfy for wish for multiple viewpoints. Questions for you:
1. Is it remotely accurate?
2. Is it more true than the summary or the article linked to?
3. Is the truth "somewhere in the middle": the original article says nothing about Wales murdering anyone, so is just a little bit of a child murderer, and is he maybe going to go to Journalists homes and just slightly murder them?
4. Is the viewpoint of the Squiggleslash Gazette worth even a split second of your time?
5. When you read the version of the story, as reported by the Squiggleslash Gazette, were you more informed, or did it make you dumber?
Compare two articles reporting on global warming. One quotes scientists, and accurately reports that the consensus within the scientific community is that smoking causes lung cancer The other fails to report that consensus, and includes only interviews with two denialists, both of whom superficially have qualifications related to health (maybe a practicing family doctor, and the director of a think tank's healthcare policy division) but neither of whom reflect the views of the majority of scientists studying in the area, and who have been found, repeatedly, to lie or misrepresent evidence. The second article presents the views of the denialists as either mainstream within medical science, or normal within science as if there's a legitimate dispute.
Is the truth "somewhere in the middle" for those two articles? Does it help you reach an informed decision to include exposure to information known to be false, without being told it's false? Are you helped if you're essentially lied to?
T-Mobile neglected to mention the "Regulatory Compliance Fees" that added $15/mo to my bill (and made them look like taxes when they're not, and no, they're not the fees for giving poor folks phone access, those have a separate line item)
That's pretty much true of all cellular companies, I've never come across one until recently that doesn't outright lie about their prices, omitting stuff like the universal service fee that's actually a cost of doing business. They lobby quite extensively to the FCC to get the FCC to agree they should be able to lie about their prices in their ads by omitting various costs-of-doing-business and adding them to bills as mandatory add-ons.
The one carrier that doesn't? Well... actually it's T-Mobile. No, not accusing you of lying, you were right up until a few months ago, it's just they've finally started to be honest about it with their T-Mobile One plan, where the prices quoted are all-inclusive.
OK I gotcha. It is shockingly easy in lazy code to write algorithms that are quadratic in memory. Arguably that's one of the big advantages of using standard morphisms and not recursions.
I also agree it is often (very often) easier to write an explicit recursion; and only then if you have to create a morphism structure. That's a different claim though than with loops. Once the algorithm is written as a loop you have all the pieces for a standard design pattern using morphisms. Which was my point to grandparent. The classification of all possible recursions is coming along nicely but we still have about 50 types of morphisms that (at least in theory) can show up. In practice hylomorphism covers most cases for recursions, and how to do this can be non-obvious. But hylomorphism covers all cases, with simple transformations of for-loops. Having written a for-loop you have the structure you need to do the morphism transformation, its the same work. My point above was about the easy case, not the hard case of general recursion you are talking about.
As an aside, I believe (not an expert) the condition for a graph traversal to be hylomorphic is that the operations follow the distributive law. Assuming I'm right on this, that's not a whole lot of math you just check your operation and apply one of the standard graph traversals.
Here we disagree. I think the general way you program that sort of thing is via. a fold. I don't know Erlang but it has the classic folds:
foldl(Fun, Acc0, List) -> Acc1
foldr(Fun, Acc0, List) -> Acc1
Fun = fun((Elem
Acc0 = Acc1 = AccIn = AccOut = term()
List = [T]
T = term()
foldl is the preferred one for Erlang
I'm going to argue there are no special cases that don't fit.
the set of all possible for loops (no side effects) \subset the set of all possible hylomorphisms (generalizations of map reduce) \subset of all possible recursions.
That's why I wanted to see a real example, because of mathematically they can't exist.
As for accumulators over loops those can be usually handled via. a fold providing the reduction operation is associative. The initial and final state never present a problem.
I'll agree I was considering lazy part of functional. At this point I think purity allows for laziness and laziness demonstrates a lot of the advantages of purity. Otherwise you are backed to mixed paradigm which I dealt with other places in this thread. As for lazy with large amounts of data, Hadoop is lazy. So I'm not sure what you are saying.
Why do you have Windows hosts on the public-facing Internet??? WHY WOULD YOU DO THAT PROFOUNDLY STUPID THING?!???!?
I was treating (**) as your second case, ignoring the (**2) as a specific function. Remember the idea originally was to show a simple example of the concept for Python.
** is a function of two variables. The 2 is coming from a different context. **2, as a squaring function is a closure. No need to be complex about closures.
It can feel like magic. The abstractions are incredibly powerful and one line does a tremendous amount.
The problem domains it shines in are niche: data parallelism, GPU programming, compiler construction. Those fields are dominated by functional languages.
What you are describing is not remotely how state is handled in functional languages today. What's done is there is a stateful monad (either State, Read, Writer, IO or State&IO) which allows for an imperative style language. That imperative language handles stateful objects and makes function calls to an engine. The engine is stateless. No one is passing around the entire state of the world.
Here is a classic paper from a quarter century ago that summarizes this approach: https://www.microsoft.com/en-u...
My sister opened a computer store in Hawaii. She sells C shells down by the seashore.