RE: Networking : PortNumber

2003-06-03 Thread Simon Marlow
> 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 univers

Re: Networking : PortNumber

2003-06-03 Thread Thomas L. Bevan
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 > PortNumb

Networking : PortNumber

2003-06-03 Thread Thomas L. Bevan
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

Re: a readFile problem

2003-06-03 Thread Hal Daume III
It would probably be helpful if you were to post the code you have and explain what part isn't working. There's a function: readFile :: FilePath -> IO String (FilePath is just a String) which reads a file. This should be what you need to solve this exercise... - Hal -- Hal Daume III

Re: a readFile problem

2003-06-03 Thread Keith Wansbrough
> However one of the commands is: read filename > i.e. read a file and display it. > I do not succeed in implementing this. http://www.haskell.org/hawiki/ThatAnnoyingIoType http://www.haskell.org/hawiki/UsingIo are your friends. --KW 8-) -- Keith Wansbrough <[EMAIL PROTECTED]> http://www.cl.c