Earlier quoted context omitted.
Yea of course, its not really the focus for me either way. my point was that how great haskell seemed in grad school didn't match up with the real world interest. I use spark for most tasks like that now. Guido stole enough from haskell that pyspark is actually quite appealing for a lot of these tasks.
> Guido stole enough from haskell that pyspark is actually quite appealing for a lot of these tasks. He didn't do his homework. Guido or whoever runs things around the python language committee nowadays didn't have enough mental capacity to realize that the `match` must be a variable bindable expression and never a statement to prevent type-diverging case branches. They also refuse to admit that a non-blocking descri…
PHP 8.5 adds pipe operator
271–280 of 282 posts
Re: PHP 8.5 adds pipe operator
#272Re: PHP 8.5 adds pipe operator
#273Earlier quoted context omitted.
> also the dreadful state of its tooling this is plain and unsubstantiated FUD > Haskell has none after 30 years > I know Haskell I doubt it
FYI instig007 is not part of the Haskell community but seems to occasionally lambast people about Haskell, risking giving the Haskell community a bad name: https://news.ycombinator.com/item?id=44199980
Re: PHP 8.5 adds pipe operator
#274Earlier quoted context omitted.
It's true that pipes are more readable, and for many cases they will be the better option, but the example of nested functions just doesn't hold. That's like saying someone would use this: $result = $arr |> fn($x) => array_column($x, 'tags') |> fn($x) => array_merge(...$x) |> array_unique(...) |> array_values(...) which is harder to reason about than the nested functions. array_values( array_unique( array_merge( ...a…
Why didn't you format the pipes, too? $result = $arr |> fn($x) => array_column($x, 'tags') |> fn($x) => array_merge(...$x) |> array_unique(...) |> array_values(...) vs array_values( array_unique( array_merge( ...array_column($arr, 'tags') ) ) ); With pipes you have linear sequence of data transformations. With nested function calls you have to start with innermost function and proceed all the way top the outermost la…
Re: PHP 8.5 adds pipe operator
#275Earlier quoted context omitted.
Agree, the ... syntax feels confusing when each fn($x) in the example uses $x as the name of its argument. My initial instinct would be to write like this: `$result = $arr |> fn($arr) => array_column($arr, 'tags') // Gets an array of arrays |> fn($cols) => array_merge(...$cols)` Which makes me wonder how this handles scope. I'd imagine the interior of some chained function can't reference the input $arr, right? Does…
You can do function ($parameter) use ($data) { ... } to capture stuff from the local environment. Edit: And you can pass by reference: > $stuff = [1] = [ 1, ] > $fn = function ($par) use (&$stuff) { $stuff[] = $par; } = Closure($par) {#3980 …2} > $fn(2) = null > $stuff = [ 1, 2, ] Never done it in practice, though, not sure if there are any footguns besides the obvious hazards in remote mutation.
My feeling is that this makes the code less legible. I'd rather write 5 lines of code that mutate an object or return a copy than do a pipe this way. I'm sort of not excited to start running into examples of this in the wild.
Re: PHP 8.5 adds pipe operator
#276Re: PHP 8.5 adds pipe operator
#277Earlier quoted context omitted.
Uhm, don't do it, then. That's like arguing that the addition of the ternary operator is a bad one because not all if/else blocks look better when translated into it. The goal is to linearlize unary function application, not to make all code look better.
I think the commenter meant that once the new syntax is approved and adopted by the community, you have no choice to not use the syntax. You'll eventually change your project and will be forced to deal with reviewing this code.
You are going to have to deal with it as a mess at some point. One of the downfalls of perl was the myriad of ways of doing any particular thing. We would laugh that perl was a write only language - nobody knew all the little syntax tricks.
Re: PHP 8.5 adds pipe operator
#278Earlier quoted context omitted.
And yet, while PHPs, Javas, and even nicher/newer languages like Kotlin, Clojure or Scala have plenty of killer software (software that makes it worth learning a language just to use that library/framework) Haskell has none after 30 years. Zero. Mind you, I know and like Haskell, but its issues are highly tied to the failure of the simple haskell initiative (also the dreadful state of its tooling).
I will not stand for this Xmonad slander
Re: PHP 8.5 adds pipe operator
#279Earlier quoted context omitted.
Latin never paid my mortgage. Helped on the SATs though.
I think the point is that there is hardly anybody to speak Latin to, much as there are hardly any actual jobs in Haskell.
Re: PHP 8.5 adds pipe operator
#280Earlier quoted context omitted.
> also the dreadful state of its tooling this is plain and unsubstantiated FUD > Haskell has none after 30 years > I know Haskell I doubt it
FYI instig007 is not part of the Haskell community but seems to occasionally lambast people about Haskell, risking giving the Haskell community a bad name: https://news.ycombinator.com/item?id=44199980
If you are to add community notes to my comments, at least add the part that clarifies that I only lambast incompetence and lies.
> risking giving the Haskell community a bad name
as opposed to those that spread FUD, I suppose? It's not the first time I'm asking this question, so what's your take on people who inflate their credibility by telling lies about the tech they clearly don't know?