I think I have found a bug in encoding/decoding things of this shape:
Array (Tuple (Tuple Int Int) Int)
Running this program:
type A = Array (Tuple (Tuple Int Int) Int)
a = [Tuple (Tuple 1 2) 3]
main = log $ stringify $ encodeJson a
returns the string [[1,2,3]] which I believe should be [[[1,2],3]]
There seems to also be an error when decoding:
type A = Array (Tuple (Tuple String Unit) Unit)
a = "[[[1,2],3]]"
main = logShow $ (jsonParser (stringify $ encodeJson a) >>= decodeJson) :: Either String A
which gives (Left "Generic json decoding failed: Expected an array: '\"[[[1,2],3]]\"'")
I'm trying to decode values from Haskell that look like [((Int,Int), Int)] but maybe Array (Tuple (Tuple Int Int) Int) isn't the correct PureScript representation.
I think I have found a bug in encoding/decoding things of this shape:
Array (Tuple (Tuple Int Int) Int)Running this program:
returns the string
[[1,2,3]]which I believe should be[[[1,2],3]]There seems to also be an error when decoding:
which gives
(Left "Generic json decoding failed: Expected an array: '\"[[[1,2],3]]\"'")I'm trying to decode values from Haskell that look like
[((Int,Int), Int)]but maybeArray (Tuple (Tuple Int Int) Int)isn't the correct PureScript representation.