125 karma · joined September 17, 2014
You have a source for that? The statistics you're referring certainly don't say anything at all to back your claim.
Edit: It looks like it doesn't happen in the primary tab and I have all the other tabs disabled which would explain it.
So what you're saying is Google took you to a page that had a very good version of the thing you were searching for?
Um, what? You can't just drop this without elaborating. I've never seen anybody have problems logging in a functional language.
https://github.com/rainbyte/frag/blob/master/src/BitSet.hs
https://github.com/rainbyte/frag/blob/master/src/Command.hs
https://github.com/rainbyte/frag/blob/master/src/Curves.hs
BangPatterns is a normal language extension to have enabled, was this used heavily? (hint: it's not enabled on "every source file.") You listed two of 28 files there, I'm assuming to try to show that the vast majority of the code in that repository is in the IO monad? You went from "vast majority" from one file to now two files. I'm looking for objectivity here, as you seem to be into. Let's see some numbers. I think anyone that glances at that repo would need some convincing of your claims.
Render.hs is 211 of 5580 lines of Haskell in the repository, by the way.
This is the claim we're talking about. Since you're into facts, not subjective opinions, show some evidence that the vast majority of the code in the repository is in the IO monad and uses carefully placed "!" eager evaluation annotations. Just to be clear, you haven't done that yet. That's a fact, not a subjective opinion.
> The vast majority of the code in that repository is in the IO monad and uses carefully placed “!” eager evaluation annotations.
Do you have anything to back that up?
Looking through that repository, I believe we have extremely different definitions of "vast majority."
Here's an SO answer from 2008 about how to enable TCO in various C and C++ compilers: https://stackoverflow.com/questions/34125/which-if-any-c-com...
There are many things both you and I have never heard of before. That's normal.
def f() =
g()
In a language implementation that doesn't optimize tail calls, the stack would look like the following after the call to g: g
f
main
In a language implementation that does optimize tail calls, the stack would look like this, because the result of f is whatever the result of g is so f is no longer needed: g
main
If a language implementation doesn't optimize recursive tail calls, the following code will quickly overflow the stack and the program will crash: def loop() =
do something...
loop()
In a language implementation that does optimize recursive tail calls, this code can run forever because loop's stack frame gets replaced with the stack frame of the new call to loop.The reason people want recursive tail calls optimized out is at a much higher level than anything to do with the actual CPU instructions being used, they just want to have a way to write recursive functions without worrying about the stack overflowing.
What's my age group, by the way?
It is though, it's a function/operator that is defined in userland.
> - oh, you need special syntax
> - oh, you need a third party library that may or may not have support for that special syntax
No, you don't need either of these things. These just add a convenient syntax that desugars to the aforementioned bind function. These PPXs aren't special keywords specifically for async/await that had to be added into the language's syntax itself. Note that I know nothing about ReScript and this reply is not about ReScript, as that's not what this comment chain is about.
Are you referring to function composition?
I think you're in a bit of an HN bubble if you honestly believe this to be true.
In this case, it's to provide a better error message in case there's an empty list than `fromList` would provide.
> You never have to worry about that value in this case because... well... that's the benefit of using `Maybe`.
But you do, your entire program doesn't live in `Maybe` so at some point you have to check whether it's `Just a` or `Nothing`. Once again, the whole point of the post is to argue that getting out of the `Maybe` as close to parsing time as possible is preferable so you have a more specific type to work with after that. You also see right away what didn't parse instead of just knowing that something didn't parse, which is what would happen if you stayed in the `Maybe` monad for all your parsing.