-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
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 areturns 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 Awhich 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.
Metadata
Metadata
Assignees
Labels
No labels