|
|
|
|
|
by tmhedberg
3568 days ago
|
|
Haskell's aeson library, which is probably the most popular way to use JSON in that language, doesn't require any of this complexity or typecasting ugliness. It can derive a typechecking parser for a particular JSON format from an ordinary Haskell data type. Your type becomes a JSON schema, and as long as the JSON you're parsing conforms to that schema, the parsing just works with a single function call. The problem you're pointing out is not a problem with statically typed languages. It's a problem with bad languages. |
|