[Haskell] Haskell-Server hGetChar

Tobe tobe at playahs.de
Tue May 10 11:45:02 EDT 2005


Hi peeps !

I got a serious problem here :-)
..........................................................
main = withSocketsDo (
        do
                socket <- listenOn (PortNumber 9900)
                print "Server online"
                loop socket)

        
loop socket = 
        do      
                (handling, host, port) <- accept socket         
                forkIO (client handling)

                loop socket
                

client handling = do

                anfrage <- hGetLine handling        -- HERE !
                let anfrage2 = umwandlungder anfrage


                ergebnis <- resultOrError (proofEngine anfrage2)
                let endergebnis = teste ergebnis
                        
                hPutStr handling endergebnis
                hClose handling
............................................................................
IŽm using hGetLine at the mom, but I need to use hGetChar for further
editing in this prog. Since I ainŽt really into haskell, I mailed you.
This Prog is supposed to get a String of following form:
"STRING 3 a&b" or "STRING 5 a & b"
So, I suggest when reading the chars in loop, I need a Escape
Character...How would you solve this ?

Thx, Tobe

-- 
Best regards,
 Tobe                          mailto:tobe at playahs.de




More information about the Haskell mailing list