On Thu, 2008-08-14 at 10:21 -0700, Don Stewart wrote:

> > I think you're right. The Binary instances cannot and must not read more
> > than they need to, so that gives us the behaviour that we read exactly
> > the length of the file, but no more, and thus we never hit EOF, so we
> > don't close the file. So yes, decode should force the tail so that it
> > can indeed hit EOF.
> 
> Duncan, 
> 
> You're suggesting that decode and decodeFile should whnf the next cell?

At least decodeFile should, since it doesn't give you any other access
to the file handle otherwise.

Does decode return the tail? I don't remember. If not it should also
whnf it. If it does then the user can choose (they might want to do
something else with the trailing data).

Duncan

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to