New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace num/fromIntegral with witch #203
Conversation
@arcz This seems a bit outdated now. Do you think it's worth trying to resolve the conflicts and merging? |
@msooseth I'll rebase and finish it |
b184754
to
c4df3db
Compare
This doesn't fix all the occurrences of |
len = num $ word $ slice 1 pre bs | ||
x | 192 <= x && x < 248 -> (1, num $ x - 192, True, True) -- short list | ||
where pre = into $ x - 183 | ||
len = fromIntegral $ word $ slice 1 pre bs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not unsafeInto
?
assertRead (idx, Lit sz, buf) = fmap (\s -> PImpl (PGEq idx (bufLength buf)) (PEq (ReadByte idx buf) (LitByte (num s)))) [(0::Int)..num sz-1] | ||
assertRead (idx, Lit sz, buf) = | ||
fmap | ||
-- TODO: unsafeInto instead fromIntegral here makes symbolic tests fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting! can you file a bug for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I think having an exception on overflow is already a very big improvement compared to silent truncation. Just one small question
Description
Closes #155.
Checklist