@@ -952,18 +952,15 @@ type ConName = String
952952contextType :: TypeName -> Parser a -> Parser a
953953contextType = prependContext
954954
955−
956−
957955-- | Add the tagKey that will be looked up while building an ADT
958956-- | Produce the error equivalent to
959957-- | Left "Error in $: parsing T failed, expected an object with keys "tag" and
960958-- | "contents", where "tag" i-- |s associated to one of ["Foo", "Bar"],
961959-- | The parser returned error was: could not find key "tag"
962960contextTag :: Text -> [String] -> Parser a -> Parser a
963−contextTag tagKey cnames = prependFailure
964− ("expected an object with key \"" ++ unpack tagKey ++
965− "\" where \"tag\" is associated to one of " ++ show cnames ++
966− ". The parser returned error was: ")
961+contextTag tagKey cnames = modifyFailure (\_ ->
962+ ("expected Object with key \"" ++ unpack tagKey ++ "\"" ++
963+ " associated to one of " ++ show cnames ++ "."))
967964
968965-- | Add the name of the constructor being parsed to a parser's error messages.
969966contextCons :: ConName -> TypeName -> Parser a -> Parser a
@@ -1163,8 +1160,6 @@ parseNonAllNullarySum p@(tname :* opts :* _) =
11631160 "expected tag field to be one of " ++ show cnames ++
11641161 ", but found tag " ++ show tag
11651162 cnames_ = unTagged2 (constructorTags (constructorTagModifier opts) :: Tagged2 f [String])
1166− --cname_ = conName (undefined :: M1 _i c _f _p)
1167− -- forall f a. ConstructorNames f
11681163
11691164 ObjectWithSingleField ->
11701165 withObject tname $ \obj -> case H.toList obj of