Networking : PortNumber

Thomas L. Bevan thomas_bevan@toll.com.au
Tue, 3 Jun 2003 17:28:05 +1000


Sorry,

I've just worked it out.

PortNumber is an instance of the class Enum
so we can use

 toEnum :: Int -> a

Tom

On Tue, 3 Jun 2003 05:25 pm, Thomas L. Bevan wrote:
> Hi,
>
> How can I take some input and convert this into a
> PortID ?
> I don't quite understand why the constructor
> PortNumber doesn't have the signature
>
> PortID = PortNumber Int | ...
>
> Instead it is
>
> PortID = PortNumber PortNumber
>
> where PortNumber is not a member of the Read class.
>
> Tom
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe