comonads, io

Andrew J Bromage ajb@spamcop.net
Fri, 3 Jan 2003 15:21:18 +1100


G'day all.

On Thu, Jan 02, 2003 at 08:08:20PM -0800, Ashley Yakeley wrote:

> So is Kieburtz smoking crack, or are we writing OI-style programs 
> incorrectly?

I mailed him the example and asked.  (I phrased the question a bit
differently, though.)

> One possibility is that comonads are useful for some 
> things, but not for doing IO actions safely.

Another possibility is that comonads aren't as suited for "standard"
pipes as monads.  The problem only happens with an implicit file
handle, as you have with getChar.  Using hGetChar it's perfectly
safe because the Handle is embedded in an OI comonad.

Yet another possibility is that we haven't quite gotten the type
signatures right on the OI primitives.

A third possibility is that everything is okay and we're just missing
something very obvious.

Cheers,
Andrew Bromage