HigherOrderCO / HVM

A massively parallel, optimal functional runtime in Rust

Home Page:https://higherorderco.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Haskell Bit Multiplication

jduey opened this issue · comments

In the Haskell bit mult. sample code, incrementing a b1 produces a 0 instead of the expected 2.
I put this in the main

print $ toU32 (inc (b1 end))

and it prints '0' to the console. Putting

print $ toU32 (inc (b1 (b0 end)))

and it prints '2' as expected. Please forgive the parens. I'm a Lisp programmer. :)

This version of inc words mod 2^bit_size. There is another version that would allow extending the bitstring, but it doesn't fuse IIRC