on master help sign in
Merge pull request #787 from ziman/reg031-sign-fix
b849041Edwin Brady
test/reg031/expected+1−1
@@ -1 +1 @@
1−[10, -128, -55, -1, 10, 51, 10, 52]
1+[10, 128, 201, 255, 10, 51, 10, 52]
test/reg031/reg031.idr+5−1
@@ -1,4 +1,8 @@
1module Main
1module Main
2
2
3main : IO ()
3main : IO ()
4−main = print . map ord . unpack $ "\x0a\x80\xC9\xFF\n3\n4"
4+main = print . map val . unpack $ "\x0a\x80\xC9\xFF\n3\n4"
5+ where
6+ -- make the values positive if the backend has signed chars
7+ val : Char -> Int
8+ val = flip mod 256 . (+256) . ord