Created
October 1, 2016 17:16
-
-
Save hudon/424d483a91b54f69f9e0c6f74735e945 to your computer and use it in GitHub Desktop.
Revisions
-
hudon created this gist
Oct 1, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ byteSum :: [Word8] -> [Word8] -> [Word8] byteSum = byteSum' 0 where byteSum' 0 [] [] = [] byteSum' 1 [] [] = [1] byteSum' carry (x:xs) (y:ys) = let v = x + y + carry in v : byteSum' (if v < x || v < y then 1 else 0) xs ys