FSharp.Json
FSharp.Json copied to clipboard
Support multidimensional arrays
For example,
let x : int[,] = Array2D.init 1 1 (fun _ _ -> 0)
I will add support for these shortly. Stay tuned.
@lkmfwe what are your thoughts regarding multidimensional arrays representation in JSON? How the should be represented in JSON? Currently I consider 2 options:
- Flat array of items
- Array of array of ... levels of nesting = number of dimensions
I think 2nd option is more suitable, because its JSON has more information. Also, Newtonsoft.Json serializes multidimensional arrays exactly like that:
open Newtonsoft.Json
let x = JsonConvert.SerializeObject(Array2D.init 3 2 (fun i j -> (i+1)*(j+1)))
printfn "%s" x
// > "[[1,2],[2,4],[3,6]]"