throw -> throwException; all tests now pass
Ignore-this: 9ca8029db67a3f2a55e74b9d2f5deb90 darcs-hash:20121203225812-76d51-341b22e3205a2d5348ab7bf2df4320824b01a172
This commit is contained in:
parent
789bc64b4c
commit
d8f94105ee
@ -108,7 +108,7 @@ instance ByteSource (StateT [Char] Identity) where
|
|||||||
fetchWord8 = do
|
fetchWord8 = do
|
||||||
chs <- get
|
chs <- get
|
||||||
case chs of
|
case chs of
|
||||||
[] -> throw UnexpectedEnd
|
[] -> throwException UnexpectedEnd
|
||||||
c:cs -> do
|
c:cs -> do
|
||||||
put cs
|
put cs
|
||||||
return (fromIntegral $ ord c)
|
return (fromIntegral $ ord c)
|
||||||
@ -144,7 +144,7 @@ instance ByteSource (StateT [Char] (Either DecodingException)) where
|
|||||||
instance (Monad m,Throws DecodingException m) => ByteSource (StateT BS.ByteString m) where
|
instance (Monad m,Throws DecodingException m) => ByteSource (StateT BS.ByteString m) where
|
||||||
sourceEmpty = gets BS.null
|
sourceEmpty = gets BS.null
|
||||||
fetchWord8 = StateT (\str -> case BS.uncons str of
|
fetchWord8 = StateT (\str -> case BS.uncons str of
|
||||||
Nothing -> throw UnexpectedEnd
|
Nothing -> throwException UnexpectedEnd
|
||||||
Just (c,cs) -> return (c,cs))
|
Just (c,cs) -> return (c,cs))
|
||||||
fetchAhead act = do
|
fetchAhead act = do
|
||||||
str <- get
|
str <- get
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user