[Haskell-cafe] Re: Hugs vs GHC (again) was: Re: Some randomnewbiequestions

Sebastian Sylvan sebastian.sylvan at gmail.com
Tue Jan 11 04:00:08 EST 2005


On Mon, 10 Jan 2005 17:12:44 -0000, Simon Marlow <simonmar at microsoft.com> wrote:

> Not a problem.  Have you looked at the streams proposal?
> 

I've missed most of the discussion on this, so if someone could just
clarify the reasons for a few things I find peculiar:

* Prefixing function names with their types, not necessary with
qualified imports.

* Why not put isEOS in the InputStream class since it doesn't make
sense for OutputStreams?

* Why not introduce an additional class BufferedStream containing the
the Buffering-functions (instead of having them in Stream and
resorting to weird failure-patterns for non-buffered streams):
setBufferMode :: s -> BufferMode -> IO ()
getBufferMode :: s -> IO BufferMode
flush :: s -> IO ()
sync :: s -> IO Bool
Where setBufferMode is not allowed to "fail" (by returning False). If
for some reason it does fail an exception is thrown. Same thing with
getBufferMode. It will return a Buffering or throw an exception (not
return "NoBuffering" instead of a failure).



/S

-- 
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862


More information about the Haskell-Cafe mailing list