News for hackers. Stuff that matters.
Re:Thoughts on Haskell by danpalmer on Saturday October 17, 2015 @02:34PM (#10405490)
While the author is entitled to their opinion, I think there are other ways of looking at most of the points made where they are advantages rather than disadvantages.

For example, the author complains about the obscure operators. I'd agree, some can be obscure, but the beautiful thing about Haskell is that they are not language operators, but rather just functions, that anyone can define themselves in the language! The fact that the power to do that is made available to the programmer, in a safe way, is something very few other languages manage.

The point about map, fmap and liftM (as I understand it, I might be wrong) is not entirely correct, in that they apply certain constraints to their usage. This helps to document the code, and also allows us to use precisely what we need, and no more, which leads to safer programming.

As for whitespace - no one likes to read or maintain code with inconsistent whitespace, which means whitespace is significant, regardless of whether the compiler cares or not. So I find this complaint is worth less than many people think.

Finally, the infix notation doesn't look particularly pretty, but you can also define infix functions, so in practice I'm not sure this matters too much.

Re:Thoughts on Haskell by kornish on Saturday October 17, 2015 @02:53PM (#10405567)
Another example of a touted inelegance which I consider to actually be incredibly helpful in practice is the positional arguments part of the post where the author says:

> For example, the Haskell function elem returns whether an element exists in a list. Do you call it with the list first or thing to search? There's no way to know.

Well, the type of `elem` is

  (Eq a, Foldable t) => a -> t a -> Bool
So, it is - with practice - clear to see that the singular item comes first, and the item in the foldable container comes second. Perhaps this sort of Type-Driven Development, which is more of a practical mindset than language feature, isn't emphasized in the (excellent) books from which the author was learning...but it becomes an invaluable tool in Haskellers' toolboxes while trawling through package documentation later on. Many times, between the name of the function and type of arguments, one can figure out exactly what they need to pass in to achieve the desired output.
Re:Thoughts on Haskell by LeonidasXIV on Saturday October 17, 2015 @03:17PM (#10405650)
> Many times, between the name of the function and type of arguments, one can figure out exactly what they need to pass in to achieve the desired output.

Yes of course because the parameters are usually designed with currying in mind, so the order is from most general on the left to the most specific on the right. In the case of elem, both orders are reasonable, but often times only one makes sense and then it is easy to remember.

Re:Thoughts on Haskell by kornish on Saturday October 17, 2015 @04:58PM (#10406057)
I'm not quite sure how you're defining "general" and "specific", but I think I don't disagree with what you're saying.

The point of my comment was more that one of the beauties of Haskell is that positional arguments are made so elegant because every positional argument is accompanied by a type. I wasn't making a statement about the order of parameters themselves, but how all parameters are typed.

> In the case of elem, both orders are reasonable, but often times only one makes sense and then it is easy to remember.

In some languages where callbacks taking positional arguments are idiomatic (like Javascript), untyped functions can cause a lot of problems by making it really hard to discern/remember what gets passed in where. In Haskell, there's often very little onus on the developer to remember anything at all; the type system will make sure they got the order right.

Obvious exceptions are non-associative functions of the type

  a -> a -> a
Then, one might have to check to see what goes in first and what goes in second.
Re:Thoughts on Haskell by tome on Sunday October 18, 2015 @09:22AM (#10408157)
> Obvious exceptions are non-associative functions ...

You mean "non-commutative"

Re:Thoughts on Haskell by kornish on Sunday October 18, 2015 @09:27PM (#10410602)
Absolutely right - good catch.
Re:Thoughts on Haskell by tome on Saturday October 17, 2015 @04:10PM (#10405850)
You seem to have missed kornish's point completely.
Re:Thoughts on Haskell by gglanzani on Saturday October 17, 2015 @03:30PM (#10405712)
I always remember what elem arguments are by thinking how would I use it in infix notation.

x 'elem' xs

Re:Thoughts on Haskell by mercurial on Saturday October 17, 2015 @05:23PM (#10406181)
> The fact that the power to do that is made available to the programmer, in a safe way, is something very few other languages manage.

As a former Perl guy, my opinion is that when you get people the opportunity to use ASCII to produce illegible code, you're sure to find people to do exactly that. That's one of the things that turned off Haskell (and Scala to a lesser extant).

Re:Thoughts on Haskell by danpalmer on Saturday October 17, 2015 @06:49PM (#10406479)
I've not been doing Haskell for that long, and I'm still very much a beginner, but so far, I'm not finding the community use of random ASCII for operator-like functions too overwhelming.

Also, I think one crucial thing is that the strictness of usage, enforced by the compiler, can help ensure that the code is used in the right way. I would feel a lot less safe doing it with Python for example (what I use day-to-day).

Also, Haskell has unicode source files, so there's even more scope, and it can lead to some funny results: https://hackage.haskell.org/package/acme-lookofdisapproval

Re:Thoughts on Haskell by malcolmgreaves on Saturday October 17, 2015 @05:04PM (#10406091)
The lack of named arguments is problematic. It looks nice for tiny, trivial, toy problems. Becomes a readability nightmare in production and public libraries.
Re:Thoughts on Haskell by zeckalpha on Saturday October 17, 2015 @06:58PM (#10406511)
Records? Pandoc and Hakyll use records with default arguments to great effect.
Re:Thoughts on Haskell by gh02t on Saturday October 17, 2015 @02:41PM (#10405516)
His point about partial application with multi-argument functions is something that has always bothered me. It's rarely a problem for me with two-argument functions since most functions have the order such that the first argument is the one you want to fix (and if not there's always flip), but with functions of higher arity it's not very elegant.