I have this function in Haskell to get perfect numbers. I want to return a list of perfect numbers.
perfect :: Int -> []
perfect digit = [presentNum | presentNum <- [1..digit], isPerfect presentNum]
isPerfect :: Integer -> Bool --function declaration
isPerfect n = n == sum [i | i <- [1..n-1], n `mod` i == 0]
but I am met with the error
- Expecting one more argument to
[]' Expected a type, but[]' has kind `* -> *'- In the type signature: perfect :: Int -> []
How do I properly return a list?