#haskell - Fri 9 Mar 2007 between 14:12 and 14:41

NY Lost Funds



pjdhaha
matthew_-gimme a clue: opening and reading files
mauke@hoogle open
lambdabotIO.openFile :: FilePath -> IOMode -> IO Handle
System.IO.openBinaryFile :: FilePath -> IOMode -> IO Handle
System.IO.openBinaryTempFile :: FilePath -> String -> IO (FilePath, Handle)
pjdmathrick: http://www.haskell.org/onlinereport/io-13.html ?
lambdabotTitle: The Haskell 98 Report: Basic Input/Output
mathrickpjd: matthew_-
fantasmaI use the io functions in prelude -- is the System.IO module better?
mathrickpjd: you might want to try /set completion_amount 0
pjdmathrick: argh, sorry
kscaldeffantasma: more like, more comprehensive
pjdhey, thanks
fantasmakscaldef: ah, well I'm only doing basic io at the moment and prelude is working fine
@hoogle read
lambdabotPrelude.read :: Read a => String -> a
Text.Read :: module
Prelude.Read :: class Read a
quicksilverHmm. It looks to me that Networ.accept is intriniscally blocking and the only way to use it in a real server is ghc threads?
sjanssenquicksilver: yes, the typical way in Haskell is to use threads
quicksilver: ghc's thread implementation scales very well, so it shouldn't be a problem
quicksilversjanssen: thanks
sjanssen: supposing I am proxying TCP (2-way). Shall I then make 2 threads per client and use blocking ops, instead of trying to handle the non-blokcing myself?
sjanssenquicksilver: probably
SyntaxNinjakzm: alive?
sjanssenthere aren't any convenient bindings to select and the like
SyntaxNinjamalcolmw: alive?
actionquicksilver nods
quicksilvernods
malcolmwSyntaxNinja: hi there
quicksilversjanssen: I don't seem to see a simple 'hGet', only 'hGetBuf' which require me to set up a buffer as a Ptr a
pjdsjanssen: doesn't it use select under the hood?
quicksilverpjd: yes, it does
sjanssenpjd: yes, it does. But you can't directly use select if you need to
quicksilverhmph I think I do need hGetNonBlocking
I never want to wait for data
pjdsjanssen: well, you wouldn't need to, would you? :)
sjanssenquicksilver: you want something like: hGet :: Handle -> IO [Word8]?
quicksilversjanssen: yes. Which fetches 'a sensible amount, whatever is avaialble, and doesn't block'
sjanssenyeah, you need hGetNonBlocking

Page: 1 8 15 22 29 36 43 50 57 64 71 78 85 92 

IrcArchive

NY Lost Funds