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