Chinese Remainder Theorem in Haskell