@@ -141,10 +141,10 @@ finalizeError ∷ String → Err → JsonDecodeError
141141finalizeError name err =
142142 Named name $
143143 case err of
144- NoCase → TypeMismatch " No case matched"
144+ UnmatchedCase → TypeMismatch " No case matched"
145145 JErr jerr → jerr
146146
147- data Err = NoCase | JErr JsonDecodeError
147+ data Err = UnmatchedCase | JErr JsonDecodeError
148148
149149-- ------------------------------------------------------------------------------
150150
@@ -251,7 +251,7 @@ instance gCasesSum ∷
251251 lhs _ = gCasesDecode encoding r1 tagged ∷ _ (Constructor name lhs )
252252 rhs _ = gCasesDecode encoding r2 tagged ∷ _ rhs
253253 case lhs unit of
254- Left NoCase → Inr <$> (rhs unit)
254+ Left UnmatchedCase → Inr <$> (rhs unit)
255255 Left (JErr err) → Left (JErr err)
256256 Right val → Right (Inl val)
257257
@@ -309,15 +309,15 @@ checkTag tagKey obj expectedTag = do
309309 ) ∷ _ Json
310310 tag ← CA .decode CA .string val # lmap JErr ∷ _ String
311311 when (tag /= expectedTag)
312- (Left NoCase )
312+ (Left UnmatchedCase )
313313
314314parseNoFields ∷ Encoding → Json → String → Either Err Unit
315315parseNoFields encoding json expectedTag =
316316 case encoding of
317317 EncodeNested {} → do
318318 obj ← lmap JErr $ CA .decode jobject json
319319 val ←
320- ( Obj .lookup expectedTag obj # note NoCase
320+ ( Obj .lookup expectedTag obj # note UnmatchedCase
321321 ) ∷ _ Json
322322 fields ← lmap JErr $ CA .decode CA .jarray val ∷ _ (Array Json )
323323 when (fields /= [] )
@@ -344,7 +344,7 @@ parseSingleField encoding json expectedTag = case encoding of
344344 EncodeNested { unwrapSingleArguments } → do
345345 obj ← lmap JErr $ CA .decode jobject json
346346 val ←
347- ( Obj .lookup expectedTag obj # note NoCase
347+ ( Obj .lookup expectedTag obj # note UnmatchedCase
348348 ) ∷ _ Json
349349 if unwrapSingleArguments then
350350 pure val
@@ -375,7 +375,7 @@ parseManyFields encoding json expectedTag =
375375 EncodeNested {} → do
376376 obj ← lmap JErr $ CA .decode jobject json
377377 val ←
378- ( Obj .lookup expectedTag obj # note NoCase
378+ ( Obj .lookup expectedTag obj # note UnmatchedCase
379379 ) ∷ _ Json
380380 lmap JErr $ CA .decode CA .jarray val
381381
@@ -537,7 +537,7 @@ instance gFlatCasesSum ∷
537537 lhs _ = gFlatCasesDecode @tag r1 tagged ∷ _ (Constructor name lhs )
538538 rhs _ = gFlatCasesDecode @tag r2 tagged ∷ _ rhs
539539 case lhs unit of
540- Left NoCase → Inr <$> rhs unit
540+ Left UnmatchedCase → Inr <$> rhs unit
541541 Left (JErr err) → Left (JErr err)
542542 Right val → Right (Inl val)
543543
0 commit comments