@@ -141,10 +141,10 @@ finalizeError ∷ String → Err → JsonDecodeError
141
141
finalizeError name err =
142
142
Named name $
143
143
case err of
144
- NoCase → TypeMismatch " No case matched"
144
+ UnmatchedCase → TypeMismatch " No case matched"
145
145
JErr jerr → jerr
146
146
147
- data Err = NoCase | JErr JsonDecodeError
147
+ data Err = UnmatchedCase | JErr JsonDecodeError
148
148
149
149
-- ------------------------------------------------------------------------------
150
150
@@ -251,7 +251,7 @@ instance gCasesSum ∷
251
251
lhs _ = gCasesDecode encoding r1 tagged ∷ _ (Constructor name lhs )
252
252
rhs _ = gCasesDecode encoding r2 tagged ∷ _ rhs
253
253
case lhs unit of
254
- Left NoCase → Inr <$> (rhs unit)
254
+ Left UnmatchedCase → Inr <$> (rhs unit)
255
255
Left (JErr err) → Left (JErr err)
256
256
Right val → Right (Inl val)
257
257
@@ -309,15 +309,15 @@ checkTag tagKey obj expectedTag = do
309
309
) ∷ _ Json
310
310
tag ← CA .decode CA .string val # lmap JErr ∷ _ String
311
311
when (tag /= expectedTag)
312
- (Left NoCase )
312
+ (Left UnmatchedCase )
313
313
314
314
parseNoFields ∷ Encoding → Json → String → Either Err Unit
315
315
parseNoFields encoding json expectedTag =
316
316
case encoding of
317
317
EncodeNested {} → do
318
318
obj ← lmap JErr $ CA .decode jobject json
319
319
val ←
320
- ( Obj .lookup expectedTag obj # note NoCase
320
+ ( Obj .lookup expectedTag obj # note UnmatchedCase
321
321
) ∷ _ Json
322
322
fields ← lmap JErr $ CA .decode CA .jarray val ∷ _ (Array Json )
323
323
when (fields /= [] )
@@ -344,7 +344,7 @@ parseSingleField encoding json expectedTag = case encoding of
344
344
EncodeNested { unwrapSingleArguments } → do
345
345
obj ← lmap JErr $ CA .decode jobject json
346
346
val ←
347
- ( Obj .lookup expectedTag obj # note NoCase
347
+ ( Obj .lookup expectedTag obj # note UnmatchedCase
348
348
) ∷ _ Json
349
349
if unwrapSingleArguments then
350
350
pure val
@@ -375,7 +375,7 @@ parseManyFields encoding json expectedTag =
375
375
EncodeNested {} → do
376
376
obj ← lmap JErr $ CA .decode jobject json
377
377
val ←
378
- ( Obj .lookup expectedTag obj # note NoCase
378
+ ( Obj .lookup expectedTag obj # note UnmatchedCase
379
379
) ∷ _ Json
380
380
lmap JErr $ CA .decode CA .jarray val
381
381
@@ -537,7 +537,7 @@ instance gFlatCasesSum ∷
537
537
lhs _ = gFlatCasesDecode @tag r1 tagged ∷ _ (Constructor name lhs )
538
538
rhs _ = gFlatCasesDecode @tag r2 tagged ∷ _ rhs
539
539
case lhs unit of
540
- Left NoCase → Inr <$> rhs unit
540
+ Left UnmatchedCase → Inr <$> rhs unit
541
541
Left (JErr err) → Left (JErr err)
542
542
Right val → Right (Inl val)
543
543
0 commit comments