Networking : PortNumber

Simon Marlow simonmar@microsoft.com
Tue, 3 Jun 2003 11:22:20 +0100


=20
> Sorry,
>=20
> I've just worked it out.
>=20
> PortNumber is an instance of the class Enum
> so we can use
>=20
>  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