Formerly u/CanadaPlus101 on Reddit.

  • 2 Posts
  • 2.23K Comments
Joined 2 years ago
cake
Cake day: June 12th, 2023

help-circle










  • They are not in NATO, actually. That requires proximity to the Atlantic. They’re Western though, that’s true. Being in a city could be a bit of a risk.

    In South America or southern Africa you’re going to deal with waves of people trying to expand in from the north. No way of life escapes that unscathed. Not to mention, the projections for food scarcity on other continents aren’t nearly as rosy, if there’s soot in the upper atmosphere, maybe because of the higher population to start with.

    And then there’s poverty as a whole separate dimension of things. Here or in Australia I’m pretty sure the capacity to build things like generators will continue. In the third world there’s absolutely no guarantee.


  • Where would you move to ride out a potential WWIII?

    Australia. There really is no better place in the event of nuclear war. It’s a continent-island, meaning easy to defend, it grows and can build just about anything, and being in the southern hemisphere it should be safe from nuclear winter.

    Specifically, a rural property somewhere agricultural. Maybe Queensland or Tasmania.

    If you could move anywhere to minimize the impact on you of the worldwide rise of fascism…

    That’s almost a different question, though. Whichever European country is the most securely democratic. There’s lots of non-war ways fascism can suck aggressively.



  • Taking a wild guess at the source of the confusion, I should be clear that I love Haskell. It’s great for a lot of what I personally end up coding, namely math things that are non-heavy by computer standards but way too heavy to solve by hand. This isn’t naysaying.

    I mean, you’re not going to be using an SQL database most likely for either of those applications (I realize I assumed that was obvious when talking about transactions, but perhaps that was a mistake to assume), so it’s not really applicable.

    To be clear, I was introducing two new examples where I think this problem would come up. It could be that I’m missing something, but I’ve had this exchange a few times and been unimpressed by the solutions offered. The IO in those cases could get pretty spaghetti-ish. At that point, why not just use a state?

    Like, using a list, which is a monad, you could code a Turing machine, and it could have a tape specifying literally anything. I can’t imagine that one would ever come up, though.

    Ironically, I actually probably wouldn’t use Haskell for heavy data processing tasks, namely because Python has such an immense ecosystem for it (whether or not it should is another matter

    It certainly is, haha. If it’s heavy Python is just calling Fortran, C or Rust anyway.




  • I’m not sure what you mean by “locality of reference”. I assume you mean something other than the traditional meaning regarding how processors access memory?

    Shit! Sorry, got my wires crossed, I actually meant locality of behavior. Basically, if you’re passing a monad around a bunch without sugar you can’t easily tell what’s in it after a while. Or at least I assume so, I’ve never written anything big in Haskell, just tons of little things.

    To give a concrete example:

    Yeah, that makes tons of sense. It sounds like Transaction is doing what a string might in another language, but just way more elegantly, which fits into the data generation kind of application. I have no idea how you’d code a game or embedded real-time system in a non-ugly way, though.

    It also has a type system that is far, far more powerful than what mainstream imperative programming languages are capable of.

    Absolutely. Usually the type system is just kind of what the person who wrote the language came up with. The Haskell system by contrast feels maximally precise and clear; it’s probably getting close to the best way to do it.



  • It is, although I’m not sure it’s complete. A list is one kind of monad, despite working like non-mutable linked lists would in any other language. They just happen to behave monadically, providing an obvious and legal interpretation of the monad functions. Going off of OP you might think monads are all Maybe.

    I will say that the concept is overhyped in at this point, at least in Haskell, and there’s a lot of monads available that do what plain functional code could but worse.


  • That’s a good run down of the “why”. The thing is, there’s way more things that are monads than things that have to be looked at as monads. AFAIK it only comes up directly when you’re using something like IO or State where the monad functions are irreversible.

    From the compiler end, are there optimisations that make use of the monadic structure of, say, a list?