6 data Bit = None | Zero | One
9 instance Show Bit where
15 instance Arbitrary Bit where
16 arbitrary = elements [ Zero, One ]
19 bit_to_int :: Bit -> Int
24 -- If we are passed a '0' or '1', convert it appropriately. Otherwise,
26 bit_from_char :: Char -> Bit
27 bit_from_char '0' = Zero
28 bit_from_char '1' = One
29 bit_from_char _ = None