
16 Jul
2007
16 Jul
'07
8:18 a.m.
claus.reinke:
in principle, Chan looks like a nice way to do pipes within haskell code, or to avoid unsafeInterleaveIO, in combination with getChanContents (which explicitly mentions hGetContents in its API doc).
however, i seem to be missing a way to close a channel? am i misinterpreting this library?
They're not attached to Handles -- that's the IO loop that does the writing to the Chan's job -- so they dont' really have a 'close'. When you're done writing, just stop writing. I often use Chan (Maybe a), with Nothing to tell the reader thread that EOF is reached -- perhaps something like that is what you're looking for? -- Don