This adds a typeclass HasLocation that can pull out source locations using the same machinery as the Data.SCargot.Common(Location) types, and uses it to provide source locations for the asWellFormed carrier type: this means that a failure in asWellFormed will now report the location of an error. That also enables variants of the decode/decodeOne functions which report readable spans on error rather than simply getting a string.
This is a backwards incompatible change! If this merges, I'll pair it with a major version bump so people are aware of the potential for breakage.
This adds a typeclass
HasLocation
that can pull out source locations using the same machinery as theData.SCargot.Common(Location)
types, and uses it to provide source locations for theasWellFormed
carrier type: this means that a failure inasWellFormed
will now report the location of an error. That also enables variants of thedecode
/decodeOne
functions which report readable spans on error rather than simply getting a string.This is a backwards incompatible change! If this merges, I'll pair it with a major version bump so people are aware of the potential for breakage.