
3 Jun
2003
3 Jun
'03
6: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
8023
Age (days ago)
8023
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow