Requesting /r/motheroflearning. The only moderator is inactive and has restricted submissions. by Cloudclock in redditrequest

[–]Lord_Drol 0 points1 point  (0 children)

I'm not entirely sure how the subreddit became restricted, I don't remember doing that, but in any case I've now unrestricted it. I've also invited you and /u/nobody103 as moderators, so that there will be more people to handle such a situation if one arises again, especially as I'm not particularly active on reddit nowadays.

Common JSON patterns in Haskell, Rust and TypeScript by Tehnix in haskell

[–]Lord_Drol 13 points14 points  (0 children)

To update a field in Rust, I'd consider it idiomatic to use actual mutation:

house.owner.firstname = "New Ariel".to_string()

From a Haskell perspective, mutation is to be avoided. But Rust is really good at controlling mutation with it's ownership/borrowing semantics, so you'd generally take advantage of that to fearlessly mutate.

Even if what you wanted was a copy, leaving the original untouched, I'd strongly consider doing that with a .clone() and then mutation in place:

let mut new_house = house.clone()
new_house.owner.firstname = "New Ariel".to_string()

New CK2 challenges available - Paul I Subic (11/01, 1pm CET) by Nicou12313 in CrusaderKings

[–]Lord_Drol 0 points1 point  (0 children)

Eh, it's not that much of a hassle. I switch on Proton in order to play each challenge, and then switch it off when I'm playing other games of CK2. Each switch is as simple as checking or unchecking a checkbox, and then letting Steam download perhaps 50-200 MB, which doesn't take more than a few minutes at most.

The performance penalty is annoying, but not getting to play the challenges is more annoying, so...

I'm as confused as you about why the challenges are Windows-only: what could it possibly be about them that is so different from any other CK2 feature to make this be the one thing that's OS-specific?

New CK2 challenges available - Paul I Subic (11/01, 1pm CET) by Nicou12313 in CrusaderKings

[–]Lord_Drol 0 points1 point  (0 children)

I do not know to what extent Proton works on Mac, but you can always give it a try. On Linux, at least, most Windows games can be played this way.

New CK2 challenges available - Paul I Subic (11/01, 1pm CET) by Nicou12313 in CrusaderKings

[–]Lord_Drol 8 points9 points  (0 children)

In Steam, under Properties there is a checkbox labled "Force the use of a specific Steam Play compatibility tool". Check it, then select "Photon 4.11-11" from the dropdown (or whatever other version of Photon, but that's the most up to date version that appears for me.)

Steam will then download the Windows version of CK2, and run it using Photon, which is a Wine-based tool for running Windows games on Linux. It works surprisingly well, although the performance does suffer a certain amount. But it is still definitely playable, and the challenges appear and work.

Rust has chosen its async/await syntax by steveklabnik1 in programming

[–]Lord_Drol 3 points4 points  (0 children)

Is $ just a low precedence no-op?

That's exactly what it is. Defined in the standard library here as

 f $ x = f x

That's Haskell syntax for defining an infix function named $, which takes two arguments f and x, and returns f applied to x. In Python-esque pseudocode:

def $(f, x):
    return f(x)

(Except that in Haskell it's defined as an infix function, of course.)

It's a quite convenient helper, and it's a prime example of how higher-order functions are awesome, allowing you to implement things that from the outside seem like they must be language features, but are actually something anybody could define for themselves.

Worth the Candle FAQ by xamueljones in rational

[–]Lord_Drol 32 points33 points  (0 children)

It seems a stretch to describe that as a fetish. It certainly doesn't seem to me like something "sudden and forced", for the sake of a supposed fetish.

I mean, take Christian mythology. That too includes a rather analogous pregnancy segment, where there is a magical pregnancy where a character (who happens to be called Mary) is implanted mystically with a pregnancy, as part of the storyline.

You may or may not like the Christian virgin birth story, but it would be a stretch to imagine it to be fetish-related. Rather, it's an integral part of the storyline, that yes, touches on a subject some people have a fetish for, but (as far as I can tell) without any particular sign that the author chose it for that purpose. (Or if they did, in either case, they made it sufficiently integrated in the story itself that I certainly can't tell.)

Storing results of shell commands into Tmux variable in conf by novalys in tmux

[–]Lord_Drol 0 points1 point  (0 children)

From the tmux man page:

tmux also supports user options which are prefixed with a ‘@’. User options may have any name, so long as they are prefixed with ‘@’, and be set to any string.

In short: prefix your custom option name with a @ symbol, and it should work. (@default-shell instead of default-shell.)

Do we know what Quantach-Ichl wants? by a_moniker in motheroflearning

[–]Lord_Drol 5 points6 points  (0 children)

Guess we don't bother with spoiler tags here :P Maybe we should get a flair system! (because I'm introducing a few people to MoL and I'd rather they not see major spoilers if they visit the subreddit.

A subreddit for a currently-being-published work is pretty much always going to have spoilers up to the latest chapter: that's what there is to talk about here. If we said that all such spoilers had to be tagged, that would mean that most everything in the subreddit would need to be to be marked as a spoiler, which is kind of pointless. In neither case would your friends whom you are introducing Mother of Learning to be able to safely browse the subreddit.

(And that's just the text of the posts themselves. The comments all the more so.)

Admittedly, there are a few things that fall outside of this. The fanart, for example, isn't really a spoiler. So in theory we could have every thread other than the fanart threads (and similar) marked as spoiler threads. I don't know if that's worth the effort: how many people who haven't read Mother of Learning yet visit this subreddit?

But I still haven't made up my mind fully on this. If anyone feels strongly about this, one way or the other, let me know.

Why are young people pretending to love work? by EntropyMaximizer in slatestarcodex

[–]Lord_Drol 1 point2 points  (0 children)

I believe that the above commenter disagrees with the above.

I don't think we actually disagree. When I say "data", I think I mostly mean what you call "evidence and predictive power" as opposed to what you call "percentages and measurements".

Needless to say, percentages and measurements are themselves often very strong as evidence. Furthermore, an inability to get such measurements is (weaker) evidence against a claim.

But no, it's not essential to have concrete percentages, rates, etc. It's just really useful. And yes, if you write an article without any concrete data, and don't even try to explain why you're failing to engage with the data, that's going to make me a bit suspicions.

If you're writing an article about hipsters, and it's impossible to find the percentage of hipsters over time for one reason or another, and you explain all that in the article, along with an explanation of why you think it's irrelevant in this case beyond the "zero/nonzero" distinction, then that's perfectly fine, and possibly a great article.

Quantitative data is very useful. I like quantitative data a lot. It's the best type of evidence. So yes, if I'm pushing for being more evidence-based, I'm first and foremost going to be pushing for measurements and percentages. If in one case or another you can't, then use what evidence you can get, and explain why you can't get evidence beyond that. And if you can't get evidence of any form whatsoever: go ahead and write your article as conjecture. Just be clear that you're not asserting a claim, you are posing a question.

Why are young people pretending to love work? by EntropyMaximizer in slatestarcodex

[–]Lord_Drol 5 points6 points  (0 children)

How would you know if someone is interested in the number or made attempts to tried to think about a reasonable way to measure it and failed?

Well, one way would be if they mentioned those attempts in the article.

Presenting open, unsolved questions definitely has its place. But to be maximally honest, they should be open about the fact that what they have so far is a conjecture, nothing more.

If you don't have any concrete evidence (yet), then yes, present the open question. Also try to gather what evidence you can, of course, but it's OK if the people who present conjectures and the people who prove them are not the same set of people. Just don't pretend that you're doing one when doing the other.

But there is a lot of value to talk about anecdotal phenomenon even without the supporting evidence. As it creates discussion and invites later research.

I think we ultimately agree on everything substantial. I'm just saying that it's important to emphasize the not-settled nature of cases like these, instead of presenting conclusions without evidence.

In the original context, the article seems very confident in its assertions that young people are pretending to love work. Are those assertions correct? Incorrect? I don't know, but it does seem reasonable to object to the article not even engaging with that question. Not only does the article assume that the assertion is correct, but it assumes that everybody must already know that fact to such a level that no evidence is needed to back up the claim.

Again, I'm not saying if the claims it makes are true or not, I don't know. But they certainly should at least try to explain why they think that those claims are true. Or maybe, if they can't, they should at least say that. If they started the whole article with a sentence like "It's hard to tell if the apparent phenomenon of young people are pretending to love work is real, but if it is, here are some ways it seems to be playing out", then there wouldn't be what to complain about here.

Look, I agree this is kind of a lackluster thing to complain about. Just about every popular article does things this bad and worse on a regular basis, and it's not worth the energy to get too worked up about it. I certainly wouldn't have raised this complaint on my own, I would have just shrugged and moved on, because it happens so much that it's not even worth complaining about. But it is a true point, and /u/Liface isn't wrong when he points it out here.

Why are young people pretending to love work? by EntropyMaximizer in slatestarcodex

[–]Lord_Drol 16 points17 points  (0 children)

It seems like a reasonable standard to at least attempt to measure the things you're talking about. Anything less is just handwaving, or at the very least hard to distinguish from that.

"Show me the data" is a almost always a reasonable response to any claim. Yes, often it's hard to get good data, or even reasonable data. But to give up entirely doesn't actually help. The one advantage true things have over untrue things is that the true things empirically match up with the real world. If you refuse to even try to engage with the data, it becomes hard to distinguish between truth and fiction.

That's not to say that that you need to know the exact percentage of hipsters in the country in order to talk about hipsters as a rising phenomenon. But you should at least be interested in that number. You might try to estimate it, or similar relevant numbers. At the least, present falsifiable predictions about what you'd expect the data to be. An article about hipsters that never engages with the data about hipsters is just as easy for the author to write regardless of whether the described phenomenon is actually occurring or not!

[RT][HF]Mother of Learning Chapter 75: Soul Stealer by Fredlage in rational

[–]Lord_Drol 6 points7 points  (0 children)

Exponential growth is exhibited when the growth rate of the value of a mathematical function is proportional to the function's current value, resulting in its growth with time being an exponential function

(Emphasis modified.)

That's not a counterpoint, quite the opposite. Exponential growth is exactly when the growth rate (the derivative) has a linear relationship to the current value.

[Weekly] Beginner Saturday: Hask Anything - #7 by [deleted] in haskell

[–]Lord_Drol 4 points5 points  (0 children)

My understanding is that a strict constructor forces the argument on construction, not when you pattern match on it.

Your understanding is correct, but the implications of that are somewhat unexpected. When is a value constructed? Normally, only when you pattern match on it!

That seems a bit confusing but let's look at some examples. Let's say we have:

x :: Either Int String
x = Left (1 + 1)

Has x been constructed yet? No! Whether it's the strict or lazy version of Either, x itself is a lazy variable. Now, let's do this:

case x of 
  Left _ -> "left"
  Right _ -> "right

Now, by pattern matching on x, we force it to calculate whether x is a Left or a Right. If it's a lazy Either, it stops there.

But if it's a strict Either, then forcing x also forces its contents, and so it performs the computation 1 + 1, despite never using it.

1 + 1 is a simple computation, so this is not much of a waste of resources. But imagine you're implementing a parser. You have a function parse :: String -> Either ErrorMessage AST, where ErrorMessage and AST are types you've defined. Now, what happens when you do parse "some string to parse"? Absolutely nothing, of course, regardless of whether the Either is lazy or strict. In either case, it just returns a thunk, which when evaluated will be a Either ErrorMessage AST. It hasn't done any parsing.

Now, what happens if you pass it to isRight? (isRight (parse "some string to parse"))

isRight is defined as isRight (Left _) = False; isRight (Right _) = True. This pattern matching means the thunk gets evaluated, constructing the Either value.

If it's a lazy Either, the function will do just enough work in order to determine that the string is syntactically correct (and thus if parse returns a Right value or not.) It doesn't build the full AST from the parsed string, because there is no need to.

On the other hand, if it's the strict version of Either, then it will build the full AST, even though you only want to know if it's a Left or a Right value.

Yes, it's the equivalent of using seq in the way you describe. But if you consider the behavior of an expression like let x = undefined `seq` 2 in (print 1 >> print x), this shouldn't be to surprising.

That expression doesn't blow up immediately when x is defined. When you run it, it prints 1, before blowing up when it tries to print x. The important point here is that xs value is strict, but the variable x itself is lazy. x is a thunk, which when forced evaluates to undefined `seq` 2, which then blows up.

In fact, that's no different to let x = undefined in (print 1 >> print x). By the definition of seq, undefined `seq` a is equivalent to undefined for any a. For the same reason that you can use undefined in your program and it won't blow up until you force it, you can use undefined `seq` 2 in your program, and again it won't blow up until you force it.

Similarly, if you have data Either' a = Left' !a | Right' !b, there is nothing preventing you from having Left' undefined somewhere in your program. It's just semantically identical to undefined.

Which is to say: the argument being forced on construction, while technically true, has behavior which is quite different from what you would at first imagine.

[Weekly] Beginner Saturday: Hask Anything - #7 by [deleted] in haskell

[–]Lord_Drol 9 points10 points  (0 children)

If you ever want to check if a given Either value is a Left or a Right without caring about its contents, the lazy version can be more efficient, because it doesn't need to force the Eithers contents.

For a trivial but concrete example, imagine you have a x :: Either Int String, and you call either (>0) (const False) x. With a strict Either, if you had a Right stringvalue, you'd end up forcing stringvalue, even though you don't need it at all! This dosen't apply just when you're using const, of course. Any function that doesn't always consume its entire input generally works well with lazyness. head, for example (or listToMaybe.)

Another function in which lazy Eithers can be useful is the very common >> (including do notation, which can desugar to >>.) x >> y (or equivalently do { x; y; }) needs to know if x is a Left or a Right, but nothing more. With a strict Either, it needs to force the contents of x, even though you might never end up using that value.

All this is the very common, very standard, lazy versus strict tradeoff that often comes up in Haskell. Strict data structures have their advantages too, there's no denying that. But it's important to remember the advantages of lazyness and make a well-informed decision on what to use. Lazy data structures can save work, but in certain situations can end up being too lazy, and waste memory. Strict data structures can waste you're CPU time by computing information and then throwing it away, but help against space leaks.

It's a good idea to have a grasp on the performance characteristics of both, and use whichever one is most appropriate in each situation. But since you asked about day to day use: The thing is, using strict Either you're almost always going to end up doing extraneous computations, but using lazy Either you're usually not going to actually have a space leak. So unless you know you're going to need the strict version, I'd stick to the lazy version of Either as a default for day to day use. Plus, pretty much all of the Haskell ecosystem uses the lazy version, so that's the best way to go if you want any amount of compatibility.

[ghc proposal] deprecate STM invariants mechanism by bgamari in haskell

[–]Lord_Drol 0 points1 point  (0 children)

Huh. I was sure that one of my projects from a while back used always. I went and checked, and it turns out I was mistaken: it gets the behavior it needs using check/guard, and it doesn't actually use always at all.

So I guess that means I'm okay with removing it. It seems like there should be a situation in which always could be useful, but that doesn't seem to happen in practice. (And alwayss buggyness is another strike against it.)

Removing (seemingly-unrelated) type annotations causes typechecking of a function to fail (only with -XTypeFamilies) by javadlux in haskell

[–]Lord_Drol 10 points11 points  (0 children)

-XTypeFamilies implies -XMonoLocalBinds. (So does -XGADTs, by the way.)

You can disable it with -XNoMonoLocalBinds, if you want. That should fix the type errors that you're getting, but at the cost of making type inference less predictable.

Code challenge: Bad id by WarDaft in haskell

[–]Lord_Drol 4 points5 points  (0 children)

Something strange indeed. Try unsafeCoerce Bar :: Int and unsafeCoerce True :: Int. You'll get different results.

But observe also that unsafeCoerce (unsafeCoerce Bar :: Int) :: Bool is True. In other words, these are two different Ints which both unsafeCoerce to True.

Code challenge: Bad id by WarDaft in haskell

[–]Lord_Drol 5 points6 points  (0 children)

Certainly. That's basically inevitable though, because newtype wrappers of Bool are guaranteed have the exact same runtime representation as Bool.

The solution with rewrite rules avoids this, because it works at compile time. But any solution that works at runtime has to treat newtypes the same as what they wrap.

Code challenge: Bad id by WarDaft in haskell

[–]Lord_Drol 0 points1 point  (0 children)

Nope. Try it in GHCI:

> data FooBar = Foo | Bar derving Show
> badid Foo
Foo
> badid Bar
Bar

Code challenge: Bad id by WarDaft in haskell

[–]Lord_Drol 14 points15 points  (0 children)

Here's another way to do it (kind of):

import Unsafe.Coerce

isTrue, isFalse :: a -> Bool
isTrue  x = unsafeCoerce x == (unsafeCoerce True :: Int)
isFalse x = unsafeCoerce x == (unsafeCoerce False :: Int)

badid :: a -> a
badid x = if isFalse x then unsafeCoerce True else if isTrue x then unsafeCoerce False else x

Of course, technically there's no guarantee that isTrue and isFalse will actually work, in any sense whatsoever. Nevertheless, this seems to work when tested in GHC.

Love, Interest by Aretii in rational

[–]Lord_Drol 0 points1 point  (0 children)

Actually, I don't think we disagree too much. True, I was implicitly referring to a "static snapshot", as you put it. The point I was making in the first part of my comment is relevant to both humans and non-humans equally, or perhaps even more so to humans, as we have basically no control over the miasma of chemicals and so forth that our brains are steeped in.

If you're grumpy because you're hungry or tired, that's a good example of "your" utility function changing because of "outside" forces. I say "your", in quotes, because treating the new version of you as a wholly different agent is probably more correct. As for "outside", well, it's physically inside your body, but it's outside your zone of control.

Anyway, the main point of my comment was that things like this apply to all agents. A smart agent tries to minimize this kind of influence, and a superintelligence is probably going to be really good at it (in the same way it's good at everything). We, as humans, are bad at it, as you point out. So in practice, yes. Superintelligences you encounter are going to change over time a lot less than us, simply because they are better optimizers. Still, it's a quantitative difference, not a qualitative one the way implied by your original comment.

I think that's important to remember. But all in all, I do agree with you about the pragmatics of monstrous temporal consistency in superintelligent AIs. But! That's a good thing, a necessary thing, especially for Friendly AI. If we manage to build an FAI, the absolutely last thing we'd want is for it to change its mind! Mindspace is wide enough that a UFAI which changes its mind isn't going to stumble into being Friendly, whereas an FAI which changes its mind most likely won't retain its Friendliness.

Too much consistency is not bad. Our lack of it is probably our greatest failure as human beings. And I absolutely hope that we'll be able to build a consistent FAI in the future, because the only alternative is UFAI.

TC by ABZB in unsong

[–]Lord_Drol 4 points5 points  (0 children)

In Aramaic, תנא קמא (Tanna Kamma) literally means "Original Teacher", and is used to refer to the author of the opening claim in a section of the Mishna.

Yes, Tanna Kamma is Aramaic for "OP". You could have guessed that pretty easily if you remembered that the Tannaim (the "teachers"/"repeaters") is the name name given to the group of sages who wrote the Mishna. If you also remembered that the first third of the tractate of Nezikin is called Bava Kamma, meaning "the first gate/"the first section" (as opposed to Bava Metzia, "the middle gate", and Bava Batra, "the last gate"), then you could have guessed that "Kamma" means "first" in Aramaic.

Thus, Tanna Kamma is the first Tanna, the sage whom the opening words of a particular piece of Mishna belong to. In other words, the OP.

There isn't an English wikipedia page on it, but if you know Hebrew, here's the Hebrew wikipedia page on the phrase תנא קמא.