[Haskell-cafe] Non-exhaustive pattern match warning (incorrect?)

Michael Orlitzky michael at orlitzky.com
Mon Dec 26 20:19:48 CET 2011


On 12/26/11 13:42, Antoine Latter wrote:
>>
>> Am I overlooking something, or did I already match Octet.None?
>>
> 
> What is your definition of the 'Octet' type?
> 

-- An Octet consists of eight bits. For our purposes, the most
-- significant bit will come "first." That is, b1 is in the 2^7
-- place while b8 is in the 2^0 place.
data Octet = None | Octet { b1 :: Bit,
                            b2 :: Bit,
                            b3 :: Bit,
                            b4 :: Bit,
                            b5 :: Bit,
                            b6 :: Bit,
                            b7 :: Bit,
                            b8 :: Bit }
           deriving (Eq)




More information about the Haskell-Cafe mailing list