add (3M) residue to haskell