Perfect number finder implemented in Haskell