[Haskell-cafe] IO typeclasses

2011-12-29 Thread David Thomas
Is there any particular reason IO functions in the standard libraries
aren't grouped into type-classes?

This might allow for:

1) Testing IO code without actual input and output. (I have done this on a
small scale, but it presently involves much ugliness).
2) Redirecting output of a function that neglects to take a handle without
a bunch of calls to dup.
3) Forwarding IO over a connection to a remote system, allowing code
written to work locally to be applied remotely, or vice-versa.
4) Wrapping dangerous IO actions in additional sanity checks.

Thoughts?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] IO typeclasses

2011-12-29 Thread Chris Wong
On Fri, Dec 30, 2011 at 4:47 PM, David Thomas davidleotho...@gmail.com wrote:
 Is there any particular reason IO functions in the standard libraries aren't
 grouped into type-classes?

I'm guessing it's to stop the report from getting too complicated. If
you want an IO abstraction, you can try HVIO:


http://hackage.haskell.org/packages/archive/MissingH/latest/doc/html/System-IO-HVIO.html

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe