
3 Jun
2003
3 Jun
'03
10:22 a.m.
Sorry,
I've just worked it out.
PortNumber is an instance of the class Enum so we can use
toEnum :: Int -> a
It's also an instance of the Integral class, which means you can just write integral constants of type PortNumber. eg. (80 :: PortNumber) is valid. Also, the universal integral conversion function 'fromIntegral' can be used for converting values of other integral types into PortNumbers (this is preferable to toEnum). Cheers, Simon