dumpString: avoid monadic pattern matching in pure code

These changes avoid the need for having a MonadFail instance for Decoder.
This commit is contained in:
Peter Simons
2018-09-28 11:45:39 +02:00
parent 5334130bf7
commit 778e32305f

View File

@@ -696,8 +696,9 @@ dumpList'' m ((l,p,t):ps) sep = do
dumpString :: Decoder Bool
dumpString = do
fmt <- asks pType
[cOMPOUND_TEXT,uTF8_STRING] <- inX $ mapM getAtom ["COMPOUND_TEXT","UTF8_STRING"]
case () of
x <- inX $ mapM getAtom ["COMPOUND_TEXT","UTF8_STRING"]
case x of
[cOMPOUND_TEXT,uTF8_STRING] -> case () of
() | fmt == cOMPOUND_TEXT -> guardSize 16 (...)
| fmt == sTRING -> guardSize 8 $ do
vs <- gets value