Hacker News new | ask | show | jobs
by trashburger 979 days ago
> I specified text: 2.1 (a number) instead of text: '2.1' (a string) - causing Stack to complain vigorously

lol, not even Haskell can escape YAML being YAML.

1 comments

Of all the complaints about YAML, I never understood this one, which is actually the correct way to handle it. Of course N.M (without some kind of quotes) is a floating point number and not a string!? The other way around would be _really_ strange.
On a general case, yes. But we are talking about Stack, a system for managing software dependencies. When was the last time you put numbers intended to be real numbers in a dependency declaration file? In different words, when was the last time you added, subtracted, multiplied or divided versions?

Version numbers are always strings with special comparison semantics.

I'm sorry, but I fail to understand the point you are trying to make.
Their point is that standard YAML is a poor fit for dependency config files.
My point is that all the numbers in a dependency configuration file should be automatically converted to strings, because they are really strings. Yaml doesn't do that.