26 karma · joined Apr 5, 2024 (2y ago) · 27 submissions
1.
Disabling Git over HTTPS for Now(inbox.sourceware.org ↗)
2 points · by corank · 10mo ago · discuss
comment 1y ago · link · parent
Essentially turning kwin into a tiling WM
comment 1y ago · link · parent
map : (a -> b) -> a list -> b list
instead of map : a list -> (a -> b) -> b list
The main argument (data to be operated on) is positioned last, after the others which are more like parameters that tune the function.
It's to allow chaining these things up left to right like Unix pipes: map f l |> filter g |> ...comment 1y ago · link · parent
My understanding is that Rust doesn't have _automatic_ reference counting as in Swift only because it has an alternative (move), which requires the programmer to specify their intent. The principle is nevertheless the same: ensure every time a reference is copied the ref count is incremented, free only when ref count is zero, and we get temporal memory safety.
comment 1y ago · link · parent
I'm not familiar with Swift though so my understanding could be incorrect.
comment 1y ago · link · parent
comment 1y ago · link · parent
This looks like a case of confused deputy problem: https://en.wikipedia.org/wiki/Confused_deputy_problem
A capability-based design should be able to systematically prevent this kind of problems.
comment 1y ago · link · parent
So print(s) returns a function that when called prints s. Then there needs to be function that joins those functions, so print(a); print(b) evaluates to a function that once called prints out a and then b.
What makes Haskell special in my opinion is 1) it generalises this way of achieving "stateful" functions, 2) enforces such discipline for you and makes sure calling functions never produces side effects, and 3) some syntactic sugar (do, <-, etc) to make it easier to write this kind of code.
Also note that the above example only does output which would be the easier case. When it comes to code with input, there will suddenly be values which are unavailable until some side effects have been made, so the returned functions will also need to encode how those values are to be obtained and used, which complicates things further.
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 2y ago · link · parent