You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While lookAhead does not consume the input, it does update the bytesRead.
test =do
x <- bytesRead
_ <- lookAhead getInt64be
y <- bytesRead
return (x, y)
> runGet test (encode (2::Int)) -- result: Right (0, 8)
I suspect this is not the desired behaviour, and that the above example should return (0, 0), to reflect that no bytes of the input have been consumed. If this is the desired behaviour, it should probably be documented.
The text was updated successfully, but these errors were encountered:
While
lookAhead
does not consume the input, it does update thebytesRead
.I suspect this is not the desired behaviour, and that the above example should return
(0, 0)
, to reflect that no bytes of the input have been consumed. If this is the desired behaviour, it should probably be documented.The text was updated successfully, but these errors were encountered: