On Tuesday, 24 September 2013 at 14:24:48 UTC, renoX wrote:
On Tuesday, 24 September 2013 at 14:15:12 UTC, Max Samukha wrote:
[cut]
I think that -> is neither unnecessary nor noise. After having played with Haskell for a while, I actually find the syntax of D unnecessarily redundant.

Oh, D is hardly a good example for syntax! Better than C++ doesn't say much..

Ok.

That said, I don't see how one could prefer 'a -> b -> c' over 'a,b -> c' in this case..

In case of Haskell, it is not a matter of preference. The syntax follows from the language semantics and I don't see how it can be different and better at the same time. (a, b) -> c means a function that maps a pair to an object (the same as ((,) a b) -> c). a -> b -> c, parens around b -> c omitted thanks to right associativity, means a function that maps an object to a function. How does a, b -> c fits in this picture?


This is not the only 'visual noise' in Haskell: for example Idris replaced '::' by ':', a good change IMHO.

That is probably because ':' is the list append operator already.

Yes, it's the other way round in Idris, but for once I prefer D's operator '~': list appending is common enough that it deserves a proper operator not a doubled one :: like in Idris or other (Scala?).


Sadly, I don't know Idris or Scala.

Now we are talking about subjective preferences, which is an exercise in futility. :)

renoX

Reply via email to