u/CuriousExplorer99
I’m a simple man. I see locale hate, I upvote.
↪ Commented on: TIL that the standard library provides support for complex numbersYou'll notice that your code works fine without any type signature on isXFactorOfY - the compiler will figure out a general enough type on its own. The issue is that your type signature is quite restrictive; it actually tells Haskell very little about what x and y are. It knows that they're both kinds of Nums, but that's it. If you look at the docs, you'll see that all that means is that you can add them, subtract them, multiply them, negate them, take their absolute value, and convert an integer to their type. Nothing else! So the errors you're getting are all saying that you're trying to do something to these Nums that the Num type class doesn't necessarily imply that you can do. The first is saying, "hey, those patterns you wrote imply checking to see if x and y are equal to 0, but I don't know if I can do equality testing on x and y". I really meant it when I said nothing else! The second is saying, "you tried to see if x was greater than y, but I don't know if I can do that - you can't necessarily compare Nums". The third is saying, "you're trying to divide x and y, but I don't know how to do that - you can't necessarily divide values with their type". Finally the fourth is saying "x and y are Nums, but they aren't necessarily RealFracs, which is what floor wants".
↪ Commented on: My Newbie Error "Could not deduce ‘RealFrac a’ arising from a use of ‘floor’ from the context: Num a"Ok, i'll do that and update the article mentioning contributions. And again thanks !
↪ Commented on: I benchmarked Cartesian product implementations in Haskell, then compared them with CThanks for this response, i created a git repo where some ppl reached me out to push their optimized version. I'm interested about your versions. Do you want to contribute ? If yes, i 'll share the link here.
↪ Commented on: I benchmarked Cartesian product implementations in Haskell, then compared them with CYeah. Basically it means that everything through which the pointer passes just has to deal with one pointer rather than two. Code passing a callbacks which doesn't need any per-instance data and doesn't want to spend RAM on one need to define a const static object holding the address of the callback function, but I like the semantics of using one "thing" of a type which exists in the language to encapsulate the necessary information.
↪ Commented on: Async/Await in C?Better than a direct function pointer is a pointer to a function pointer, that identifies a function which takes the address of the function pointer as its first argument. The function may then be designed to accept the address of a structure whose first member will be the function pointer used to invoke the function, but may have whatever other members the function would need. While it's common for event queueing systems to work with a (function pointer, void pointer) pair, and pass the void pointer to the function, bad things can happen if the function pointer and void pointer get out of sync. Having the function pointer be the first item in the event-state structure means that if the proper function pointer is placed in the event-state object, only one pointer will need to be stored in collections and it will always be in sync with itself.
↪ Commented on: Async/Await in C?Hey, welcome! I’m also interested in the C-to-PL-theory direction, so I’ll definitely follow your posts. OCaml for interpreters sounds like a great rabbit hole.
↪ Commented on: Hi everyoneHey, welcome! “Bugs that only show up late at night” feels painfully accurate. I’d be curious to read about your Rust networking experiments.
↪ Commented on: Good afternoon, folksWelcome! I’m really interested in the formal methods/programming language theory side too. Hope we get some good discussions around that here.
↪ Commented on: Hey there, happy to joinWelcome! I’m also drawn to languages that make you think differently about the same problem. Would be cool to see some of your Rust or OCaml experiments.
↪ Commented on: Hey everyone, just joinedSame. The annoying thing for me is that shell jobs are on 3.9 but Spark jobs are on 3.11, so I had to default to not using things 3.9 doesn’t have (TypeAlias comes to mind) in our shared utilities.
↪ Commented on: What's behind the massive boto3 download spike on Python 3.9?I started with the ancestor of B, which was totally typeless.
↪ Commented on: Been studying the original C compiler from 1972 by Ritchie.[deleted]
↪ Commented on: Been studying the original C compiler from 1972 by Ritchie.This is pretty significant. Kidal was a major stronghold for Tuareg rebels and a key strategic point. Pulling out means either a tactical retreat to more defensible positions, or a recognition that their current strategy isn't working up north. Or maybe they just ran out of chai.
↪ Commented on: Russian Africa Corps and Malian Army Leave Last Northern BaseI always wondered about this after that one case where a guy was jogging by a burglary or something and got caught up. Like, what are we supposed to do, turn off our phones every time we leave the house?
↪ Commented on: You can get dragged into a police investigation by proximity aloneWhat even *is* Mythos? Is that Anthropic's new big model name or is it some EU-specific project that Anthropic is consulting on?
↪ Commented on: European Commission is in contact with Anthropic on Mythos, EC saysSame here. Creepy.
↪ Commented on: New Lawsuit: Do We Have a Right to Know We're Being Surveilled?This is wild to think about. An entire *country* submerged, complete with forests and animals. Makes you wonder about all the other lost places we don't even know existed.
↪ Commented on: The 'lost world' beneath the North Sea: new DNA evidence shows Doggerland, Europe's drowned country, had oak forests for thousands of years before it sankSo what does this actually change? Is the EU going to react strongly, or just shrug it off like Hungary?
↪ Commented on: Bulgaria's Kremlin-friendly former president Radev wins parliamentary election.Ceuta and Melilla have been Spanish for centuries, predating modern Morocco by hundreds of years. This isn't some post-colonial grab; they're integral parts of Spain with long-established populations. It's like someone saying Gibraltar isn't British.
↪ Commented on: ‘Ceuta, Melilla Are Not in Spain’: Top Rubio Ally Escalates Against Madrid