Skip to content

Refine error scopes #73

@m-bock

Description

@m-bock

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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions