Parsing a large Json array in Haskell and strictly converting its elements
I have a json file containing (among other things) a large nested array of multiprecision floating point numbers. Each floating point number is a quoted string of digits, e.g. “3.14159265358979323846264338”. I would like to parse the file and, as each element is read, immediately convert it to a numerical datatype (specifically a multiprecision float from this mpfr library). The reason is that multiprecision floats take up much less memory than the corresponding string of digits. I am willing to store a large array of floats in memory, but I do not want to store all the text from the file in memory.