Skip to content

Commit cb6b1d4

Browse files
committed
Cleanup
1 parent 2dd4256 commit cb6b1d4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Data/Codec/Argonaut/Sum.purs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ finalizeError ∷ String → Err → JsonDecodeError
141141
finalizeError name err =
142142
Named name $
143143
case err of
144-
NoCaseTypeMismatch "No case matched"
144+
UnmatchedCaseTypeMismatch "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 NoCaseInr <$> (rhs unit)
254+
Left UnmatchedCaseInr <$> (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

314314
parseNoFields Encoding Json String Either Err Unit
315315
parseNoFields 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 NoCaseInr <$> rhs unit
540+
Left UnmatchedCaseInr <$> rhs unit
541541
Left (JErr err) → Left (JErr err)
542542
Right val → Right (Inl val)
543543

0 commit comments

Comments
 (0)