4 ms·
So much chuckling. I too can't help but chuckle at some of the substance less commentary at HN, where chuckling is a substitute for inability to contribute any
by random314 7y ago
So much chuckling.
I too can't help but chuckle at some of the substance less commentary at HN, where chuckling is a substitute for inability to contribute anything to a discussion.
- tasuki 7y agoYour comment is a little harsh.
- asdkjh345fd 7y agoI don't think it is harsh enough. The comment is devoid of substance and wrong.
- jcelerier 7y agocare to detail how do x <- a y <- b return (f x y) isn't basically imperative syntax ? hint: if you can get from it to C (or pascal or python or whatever) simply by adding a couple types, semicolons and replacing operators, it's C.
- lmm 7y agoHow is that any more or less imperative than the standard Haskell syntax: let x = a y = b in (f x y) ? Which in turn is very much like OCaml syntax or plenty of other functional syntaxes.
- jhomedall 7y agoIIRC that desugars to a >>= (\x -> b >>= (\y >>= return (f x y))) . I don't write Haskell, so that might be slightly off This could be doing any one of: - flatmapping over lists - doing a computation with Maybe types, producing Nothing if a or b are nothing - doing IO - managing futures - pretty much anything, actually Don't confuse 'x <- a' with assignment, or 'return' with returning a value. Another way of looking at it, (f x y) might be invoked: - once - never - more than once - later
- asdkjh345fd 7y agoThere is no such thing as imperative syntax. Syntax is completely orthogonal to being imperative, which is semantic not syntactic. It isn't "almost C-like syntax", unless you define that to mean "if I do any amount of search and replace I can make it into valid C code that has completely different semantics". "x <- a" in haskell is not at all the same as "x = a" in C. And that isn't the reason I said your comment is wrong. Your comment is wrong because do notation is not the result of "40 years of research in functional PL", nor is it an accomplishment. It is simple syntactic sugar that didn't come from research at all. Your comment could be accurately summarized as "I would like to express how smug I feel for not learning something".
- jcelerier 7y ago> Your comment is wrong because do notation is not the result of "40 years of research in functional PL" are you kidding me ? if a 2016 paper from Simon Peyton Jones isn't research then what is ? (https://dl.acm.org/doi/pdf/10.1145/3241625.2976007 https://dl.acm.org/doi/pdf/10.1145/3241625.2976007)
- asdkjh345fd 7y agoHave you considered reading it?
- jcelerier 7y agowould you consider showing me a previous appearance of ApplicativeDo (not do notation of course, that shit is almost older than me) in scientific literature before that paper ? As surely, if a concept had existed for a long time it would be more relevant to start by the original paper that introduced it ?
- random314 7y agoOf course, the only thing 40 years of PL research resulted in was the do notation. I was under the impression that the do notation was syntax sugar for any kind of Monad - List, nondeterminism, asynchronous iO, parser combinations, exceptions etc. Stuff that appears as language features in other languages, but are just a library in Haskell. But your chuckle has shown me that this code is just plain old C, with links to documents you haven't even read. Thank you for enlightening me, great chuckler.
- random314 7y ago> hint: if you can get from it to C (or pascal or python or whatever) simply by adding a couple types, semicolons and replacing operators, it's C. hint: you are wrong.
- cannabis_sam 6y agoBecause it’s one big expression. A C version would have statements.
- random314 7y agoDon't think you have noticed. But there is a chuckling epidemic on HN. It acts as a tool to appear smug and superior while not providing any sensible argument or logic. The last time there was someone chuckling, I was way more civil. https://news.ycombinator.com/item?id=22712767 https://news.ycombinator.com/item?id=22712767
- ljm 7y agoI suppose you must be chuckling at yourself then. And me, now. And everyone else who replies. This thread is silly.