As a starting point, first: import Test.QuickCheck
which already defines Arbitrary instance for Int
Then write a property:
prop_validate_port port =
if port > 0 && port <= 65535
then validatePort port == Right port
else validatePort port == Left "Port must be between 1 and 65535 inclusive"
And run the test:
>quickCheck prop_validate_port
>+++ OK. passed 100 tests.