$result = $arr
->column('values')
->merge()
->reduce(fn($carry, $item) => $carry + $item, 0)
->repeat('x');
I think this just comes down to familiarity.165 karma · joined November 12, 2009
$result = $arr
->column('values')
->merge()
->reduce(fn($carry, $item) => $carry + $item, 0)
->repeat('x');
I think this just comes down to familiarity.You might want to take a look at what browsers have been working on lately, because a lot of what you're asking is either already here or actively developed. Some of it driven by the Open UI working group (https://open-ui.org).
- Modal: see the <dialog> element, with its focus trapping out of the box, stylability through the top layer, entry and exit animations through @starting-style and the ability to transition discrete properties like `display`, etc.
- Rich dropdown: browsers now support popovers, which allow you (without any JS) trigger a popover that overlays the screen in the top layer, and with automatic focus management. See also the work being done on stylable <select> elements, there's a great episode of Off The Main Thread that goes deep into all the work being done to make this happen [1].
- Carousel: see the recent work on stylable <details> elements [2], and in general the carousel project at Open UI. After <select>, the carousel is one of the main focus areas.
[1] https://offthemainthread.tech/episode/stylable-select-elemen...
> But we've had a pretty good definition of abstraction since 1977, originally in the context of program analysis, and — I claim — it actually translates quite well into a precise definition of “abstraction” in engineering.
So I don't think the author is saying that all these other people are "wrong", but rather that this one particular definition seems to capture the underlying essence of what we intuitively think of when we say "abstraction", and the rest of the "hodgepodge of different concepts" break down if you analyze them a bit deeper (as the author did in the "Not Abstraction" section).
Of course this assumes the lambda is pure, but in the kind of code we're talking about (pseudofunctional code with lots of higher-order functions) they should be pure for the most part.
:)
const head = ([x, ...xs]) => x;
const tail = ([x, ...xs]) => xs;
const map = (list, fn) => {
if (list.length === 0) {
return [];
} else {
return [fn(head(list)), ...map(tail(list), fn)];
}
};
map([1, 2, 3], x => x + 1); // [2, 3, 4]
We're not keeping track of any state here. Using recursion you don't need to keep track of the current element in the list for example (when you run this on a physical machine it will of course, but not at the conceptual level).https://en.wikipedia.org/wiki/Gymnasium_(school)
> I've gone through high school and taken CS (and a bit of discrete math and logic) in college, and never seen the ⊢ symbol before.
Interesting. I was taught ⊢ first semester in CS in Logic class. Along with most other common logic notation.
I guess if I were to mention one thing I really miss in Haskell it's having easy, generic dictionary types a la JSON. Give me some syntax sugar to write a dictionary like JSON objects, where the properties are ordered by insertion (unlike most HashMaps that are unordered or rely on some predefined Key ordering). Also I'd love some better record types.
https://github.com/tannerlinsley/react-table#features
So the comparison to HTML tables is a bit odd, because (as per the article linked by OP) it does pretty much everything except the UI part.
(I'm not the author, I just use this library at my work.)
https://developer.mozilla.org/en-US/docs/Archive/Web/E4X_tut...
Found it ironic that in a comment about Lisp, Kay forgot to balance his parens. :)
> The Intergovernmental Panel on Climate Change (IPCC) is the UN body for assessing the science related to climate change. It was established by the United Nations Environment Programme (UN Environment) and the World Meteorological Organization (WMO) in 1988 to provide policymakers with regular scientific assessments concerning climate change, its implications and potential future risks, and to put forward adaptation and mitigation strategies. It has 195 member states.
> IPCC assessments provide governments, at all levels, with scientific information that they can use to develop climate policies. IPCC assessments are a key input into the international negotiations to tackle climate change. IPCC reports are drafted and reviewed in several stages, thus guaranteeing objectivity and transparency.
> The IPCC assesses the thousands of scientific papers published each year to inform policymakers about the state of knowledge on climate change. The IPCC identifies where there is agreement in the scientific community, where there are differences and where further research is needed. It does not conduct its own research.
> To produce its reports, the IPCC mobilizes hundreds of scientists. These scientists and officials are drawn from diverse backgrounds. Only a dozen permanent staff work in the IPCC’s Secretariat.
I can think of two in my lifetime. The one you mentioned in Utrecht, and the Alphen aan den Rijn one in 2011. Even accounting for population size it's nowhere near the severity/frequency of the US.
> Gun control did nothing to stop that.
Gun control obviously isn't going to stop every attack. That doesn't mean it can't prevent many of them.
But it's usually phrased as "there's nothing we can do" and gun control wouldn't help, which is dishonest.
Changes to the constitution can and do happen. And it's kind of beside the point anyway because a degree of gun control already exists in the US without being in conflict with the constitution.
> US doesn't pretend to be the same as all the other countries
Clearly. You're also the only one where this is such a problem.
But in any case Dhall does actually follow a norm rather closely, just a different norm than the grandparent is used to. Namely, ML and other functional languages/research. Which makes sense since Dhall is a product of that community.
I think you mean Ryan Dahl haha