@olafurw This is my interpretation:
1. Pick (🤏) a pivot element, then (➡️) split (🔀) i.e. partition the remaining elements according to which one is larger (📈)
2. recurse (🔄) on the left (🔄) and right (🔄) halves until you're done (🛑)
3. Repeat (🔁) steps 1 and 2 in alternating order so that the last thing you perform is step 1
Fast Map Union and Local Instances Through Instance Types
https://prophetlabs.de/posts/insttypes.html
Discussions: https://discu.eu/q/https://prophetlabs.de/posts/insttypes.html
After *checks notes* 6 months, I finally finished another blog post!
This time I actually got it working without segmentation faults or undefined behavior.
I did discover a bug in GHC 9.2 though
The Onion is on a roll. https://www.theonion.com/evangelical-leaders-announce-j-k-rowling-finally-bigot-1850129128
@eniko pandoc runs on windows, right?
@chshersh @sjoerd_visscher You should probably be able to recover associativity if you merge the `object <> array` case slightly differently.
I think something like
`{ x : 1} <> [2] = { x : 1, data: [2] }`
should be associative?
== Structural Logging in Haskell, Part 1 ==
Okay, let's write some useful #Haskell content here for a change.
When you do logging in sophisticated applications, you're generally logging JSON objects instead of raw texts. Most logging query engines are optimized for searching and filtering JSON values.
However, often you get pieces of information from different sources, and it makes sense to combine them into a single JSON object.
On this note, I would like to introduce a function for merging two JSON objects.
I'm a bit confused why I haven't seen this function either implemented properly or at all in any of the projects or libraries I've seen. It looks like a natural way to merge two JSON objects losslessly.
**UPDATE:** As noted in the comments, the below function is not associative which makes its behaviour less reliable and predictable.
> Previously, I was worried too much about the performance of merging two JSON objects and I researched various logging optimizations, including dependently typed statically known maps for optimized merging. But after working on real projects for a while, I realized that performance here doesn't matter anyway.
The full code can be found here:
https://gist.github.com/chshersh/42bc097c8558aa12fd83bb06c4f455fd
I also used the new \cases keyword from GHC 9.4 which is perfect for such cases (pun intended).
Happy coding! 🍀
New blog post: Polygons from paragraphs: turning a 3D model into HTML and CSS
https://hikari.noyu.me/blog/2023-01-10-polygons-from-paragraphs-3d-model-html-css.html
Haskell
OCaml
Polaris
Rust
C
C++
x86_64 Assembly
Agda
Java
SQL
@me_ perfect response
Honestly the state of the internet is miserable if you're trying to learn things.
Like, you want to learn how to care for an animal? Well, every Google result is a bot generated fake blog. Maybe try YouTube? Well, you have a few new options: there's the person who just got this animal for the first time talking like experts about them. Or there's the literal child telling you what they learned about caring for hamsters from the bot generated fake blogs they just looked up.
This goes for almost anything anymore. There's no expertise, the only advice is just from whoever is the best at SEO, which is often not an actual person. But if it is they probably know as much as you do.
In the last 6 or 7 years I've found myself more and more just digging up ebooks from people who know what the fuck they're talking about.
@lori A fun consequence of this is that it is usually easier to find information about things that almost nobody uses
Haskell's monads can be used to implement CONEFROM
Today I woke up (went to bed actually) and chose violence apparently.
https://gist.github.com/Innf107/ebc0cda7173dde07b525dc3d8634ca0b
(Also thanks to https://cohost.org/leftpaddotpy for the nerdsnipe)
1/ Many will tell you why Python is great for teaching coding, so I'll tell you ways it's not.
State is a bad default. It should be legal but safe & rare. The arc of programming is long and bends towards immutability. Its early use creates messes (eg, "a variable is a box".)
2/ Rich and robust programming requires a strong understanding of data models and invariants. Python is weak at expressing either of those. You don't notice it until you miss it. ↵
re: cw: stallman epstein take
re: cw: .NET hate
@cafkafk it's wild to me how many people there are that have like 40 years of experience, but have never used and don't even know anything besides NET
@a11ce Minecraft, Stardew Valley, Portal, Terraria, maybe Valheim (this one is more fun with friends though)
Update: apparently, init depends on libcrypto as well, so rebooting caused a fucking kernel panic
This "person" has a superficial similarity to https://cohost.org/prophet but it is in fact a malevolent agent of chaos. It unpicks the seams of reality (and the Fediverse) so that the normal rules no longer apply. It lulls you into thinking it is reasonable, but when you are not looking it stabs you in the back and aliases all of your mutable buffers. The carcass of many a seasoned Haskell programmer lie strewn at its feet.
Do not talk about "safe"! You do not know what is safe!