[Haskell-cafe] Standard package file format

Bardur Arantsson spam at scientician.net
Sat Sep 17 04:47:52 UTC 2016


On 2016-09-16 23:57, Herbert Valerio Riedel wrote:

> Besides, many YAML (& JSON) parsers silently drop duplicate keys, so if
> by accident you place a 2nd `else:` branch somewhere, you end up with an
> ambiguous .yaml file which may either result in an error, in the first
> key getting dropped (most likely variant), or in the 2nd key getting
> dropped. Which one you get depends on the YAML parser implementation.

I was actually curious about this, and it's interesting to note that
even JSON which was supposed to have *ONE STANDARD* now apparently has
two, an ECMA one and and IETF RFC (seems to be more recent).

So I'd say JSON technically _allows_ duplicate keys, but that you cannot
reasonably any type of sane behavior in practice if you do
that.

Source: http://stackoverflow.com/a/23195243

(Didn't check up on what the situation is in YAML. YAML is too awful to
contemplate regardless.)

Regards,



More information about the Haskell-Cafe mailing list