News for hackers. Stuff that matters.
Re:Help me sort out the meaning of “{}” as a constructor arg... by marcosdumay on Tuesday November 22, 2016 @03:15PM (#13017256)
Haskell has syntax that is as problematic as this one, and a huge number of extension combinations that nobody can be sure not to be problematic.

I'm running into it as much as I can too, but it does look like a language we should replace with something simpler once we get an specification that works.

Re:Help me sort out the meaning of “{}” as a constructor arg... by pklausler on Tuesday November 22, 2016 @03:49PM (#13017523)
> Haskell has syntax that is as problematic as this one...

Examples, please.

Re:Help me sort out the meaning of “{}” as a constructor arg... by marcosdumay on Tuesday November 22, 2016 @04:10PM (#13017685)
I've just looked at this line in darcs documentation:

    (Patchy p, (~) ((* -> *) -> *) (ApplyState p) Tree) => Patchy (PatchInfoAnd rt p)
Re:Help me sort out the meaning of “{}” as a constructor arg... by pklausler on Tuesday November 22, 2016 @04:17PM (#13017743)
The C++ usage (T x{{}}) is problematic because its interpretation is so obscure as to flirt with ambiguity and lead to program-breaking changes in compilers as their semantic analyzers improved. The Haskell line you cite isn't ambiguous at all.
Re:Help me sort out the meaning of “{}” as a constructor arg... by marcosdumay on Tuesday November 22, 2016 @04:47PM (#13017965)
Ambiguity, yes it has none.

About obscurity, how many GHC extensions were required to make it accept this code? (Is GADT enough?) And by the way, this is in the interface, while the C++ example is in the implementation.

Besides, that's Haskell code that happens in practice. This is one I've just looked at, if I did some research I would certainly come up with more egregious code (maybe even mine). This one probably isn't even problematic (it's hard to say from the interface), but in general, mixing those extensions does lead to some very interesting problems from time to time.

Haskell has the same excessive complexity problem that C++ suffers. I do think this is the right thing to do right now. But I can't imagine it not looking as dated in 4 decades as C++ is now.

Re:Help me sort out the meaning of “{}” as a constructor arg... by tome on Tuesday November 22, 2016 @05:19PM (#13018194)
Ah, but most of the complexity in that line is an artifact of how Haddock (egregiously badly) generates documentation. The line in the source code is

    instance (Patchy p, ApplyState p ~ Tree) => Patchy (PatchInfoAnd rt p)
I don't personally like typeclassitis, but this is actually easy to interpret:

"If 'p' is a patch-like thing, and its ApplyState is a Tree, then 'PatchInfoAnd rt p' is a patch-like thing"