@@ -544,7 +544,7 @@ instance ( FromPair (a :+: b)
545parseAllNullarySum :: SumFromString f => Options -> Value -> Parser (f a)
545parseAllNullarySum :: SumFromString f => Options -> Value -> Parser (f a)
546parseAllNullarySum opts = withText "Text" $ \key ->
546parseAllNullarySum opts = withText "Text" $ \key ->
547− maybe (notFound $ unpack key) return $
547+ maybe (notFound key) return $
548 parseSumFromString opts key
548 parseSumFromString opts key
550class SumFromString f where
550class SumFromString f where
@@ -571,13 +571,13 @@ parseNonAllNullarySum opts =
571 TaggedObject{..} ->
571 TaggedObject{..} ->
572 withObject "Object" $ \obj -> do
572 withObject "Object" $ \obj -> do
573 tag <- obj .: pack tagFieldName
573 tag <- obj .: pack tagFieldName
574− fromMaybe (notFound $ unpack tag) $
574+ fromMaybe (notFound tag) $
575 parseFromTaggedObject opts contentsFieldName obj tag
575 parseFromTaggedObject opts contentsFieldName obj tag
577 ObjectWithSingleField ->
577 ObjectWithSingleField ->
578 withObject "Object" $ \obj ->
578 withObject "Object" $ \obj ->
579 case H.toList obj of
579 case H.toList obj of
580− [pair@(tag, _)] -> fromMaybe (notFound $ unpack tag) $
580+ [pair@(tag, _)] -> fromMaybe (notFound tag) $
581 parsePair opts pair
581 parsePair opts pair
582 _ -> fail "Object doesn't have a single field"
582 _ -> fail "Object doesn't have a single field"
@@ -585,7 +585,7 @@ parseNonAllNullarySum opts =
585 withArray "Array" $ \arr ->
585 withArray "Array" $ \arr ->
586 if V.length arr == 2
586 if V.length arr == 2
587 then case V.unsafeIndex arr 0 of
587 then case V.unsafeIndex arr 0 of
588− String tag -> fromMaybe (notFound $ unpack tag) $
588+ String tag -> fromMaybe (notFound tag) $
589 parsePair opts (tag, V.unsafeIndex arr 1)
589 parsePair opts (tag, V.unsafeIndex arr 1)
590 _ -> fail "First element is not a String"
590 _ -> fail "First element is not a String"
591 else fail "Array doesn't have 2 elements"
591 else fail "Array doesn't have 2 elements"
@@ -791,6 +791,6 @@ newtype Tagged2 (s :: * -> *) b = Tagged2 {unTagged2 :: b}
792--------------------------------------------------------------------------------
792--------------------------------------------------------------------------------
794−notFound :: String -> Parser a
794+notFound :: Text -> Parser a
795−notFound key = fail $ "The key \"" ++ key ++ "\" was not found"
795+notFound key = fail $ "The key \"" ++ unpack key ++ "\" was not found"
796{-# INLINE notFound #-}
796{-# INLINE notFound #-}