It's very cool, but also no wonder that it doesn't support all those features of regexes which technically make them not regular expressions anymore. Though, I would have thought ^ and $ anchors shouldn't be a problem?
^ and $ are a problem, although one with a workaround.
The standard theory of regular expressions focuses entirely on regex matching, rather than searching. For matching, ^ and $ don't really mean anything. In particular, regexp theory is defined in terms of the "language of" a regexp: the set of strings which match it. What's the set of strings that "^" matches? Well, it's the empty string, but only if it comes at the beginning of a line (or sometimes the beginning of the document). This beginning-of-line constraint doesn't fit nicely into the "a regexp is defined by its language/set of strings" theory, much the same way lookahead/lookbehind assertions don't quite fit the theory of regular expressions.
The standard workaround is to augment your alphabet with special beginning/end-of-line characters (or beginning/end-of-document), and say that "^" matches the beginning-of-line character.
A lack of `^` is equivalent to prepending `(.*)`, then trimming the match span to the end of that capture. And similarly for a lack of `$` (but suddenly I remember how nasty Python was before `.fullmatch` was added ...).
More interesting is word boundaries:
`\b` is just `\<|\>` though that should be bubbled up and usually only one side will actually produce a matchable regex.
`A\<B` is just `(A&\W)(\w&B)`, and similar for `\>`.
Perhaps they would remove it if they are concerned their platform could be incentivizing wrong, dangerous or stupid behavior and they worry about the brand damage that does or have ethical problems profiting off that.
This is what I was thinking. I didn't find the video here on HN. A few weeks ago my 11 year old son told me about it. Like a lot of kids his age, becoming a YouTuber is aspirational, and his reaction was "that is crazy" but it was also "this guy just raised the ante on Mr. Beast." It's only going to make some YouTubers try to top it with some kind of dangerous Johnny Knoxville-type stunt.
"Wrong" = criminal (?) maybe. Though this guy hasn't actually been prosecuted and may well never be.
But if you're going to ban dangerous/stupid video someone has to make that determination. And you can be sure that there are a ton of activities that are dangerous/stupid in the eyes of some people (even understandably so). BASE jumping, wingsuits, really any kind of extreme sports, stuff with explosives, etc.
> It's only going to make some YouTubers try to top it with some kind of dangerous Johnny Knoxville-type stunt.
People were doing stupid stuff before YouTube existed. As long as it's legal (which this stunt was not) who cares? Teach your son why he shouldn't do that kind of stuff instead of turning to censorship.
Nowhere did I advocate censorship. But I do think it should be illegal because this stunt could have started a wildfire if the plane had started burning.
Predicting 50% can be validated: if I say a coin will be heads 50% of the time, I know more than nothing: I know more than someone who incorrectly claims it will be heads 75% of the time.
And we can quantify in various ways how much better the 50% prediction is than the 75% prediction.
A big reason to use IO as a value (which IMO is a better name than IO monad), is the same in all languages: reasoning about immutable values is easier than side effects. If we can take complex IO operations and use composition tools exactly the same as other immutable values, it’s very nice.
Of course, in my experience, this is so foreign to people who haven’t worked with it for a time it is very difficult to sell in small reply.
That's why a lot of functional language research is moving towards effect handlers, which could be explained in a nutshell as "coroutines, but for anything"
“ In any case, the model makes a testable prediction. If the sunspots are less frequent over the coming 20 years, she was right!”
Interesting goal posts: scientist working on carbon’s effect on the climate need to consider all kinds of other potential explanations despite their predictions of continued short term warming coming true. This person is in the fortunate position that she should be believed, not doubted as a coincidence as mainstream scientists should be, if her prediction comes true in a decade.
And if she’s wrong I guess we just say “...fuck...”
No, but surprisingly frequently this property holds: if your function is generic enough, there is only one (or a small number) of possible implementations that type check.
It’s a really incredible demonstration of some highly non-trivial operations on regular expressions.