Consider the following sample ADT:
data Sample
= Foo
| Bar Int String
| Baz
and a wrongly encoded JSON:
{
"tag" : "Bar",
"value": [1, true]
}
It should produce an error similar to:
(Named "Sample" (Named "at case `Bar`" (AtIndex 1 (TypeMismatch "...."))))
Looking at it now, ideally JsonDecodeError would have an additional constructor AtCase.
@garyb Would you be up for extending JsonDecodeError?
Consider the following sample ADT:
and a wrongly encoded JSON:
{ "tag" : "Bar", "value": [1, true] }It should produce an error similar to:
Looking at it now, ideallyJsonDecodeErrorwould have an additional constructorAtCase.@garyb Would you be up for extendingJsonDecodeError?