error-checking hamming codes in haskell