Skip to content

Instantly share code, notes, and snippets.

@garious
garious / BitVectorTest.hs
Created November 21, 2012 23:20
fixed-length vectors?
import qualified Data.Vector.Unboxed as V
import Data.Bits(setBit)
import Data.Word(Word8)
main :: IO ()
main = do
assertEqual 0x8c $ byte (bitsLE "0011" V.++ bitsLE "0001")
putStrLn "passed"
-- Create a bit-vector from a little-endian string of 1's and 0's