Readline read_history and write_history addition

Alexander Dunlap alexander.dunlap at gmail.com
Sat Feb 2 13:35:19 EST 2008


On Jan 23, 2008 5:19 AM, Yitzchak Gale <gale at sefer.org> wrote:
> > > Those are asynchronous phenomena.
>
> > I'm not sure what you mean by that?
> > It's a synchronous exception.
>
> Sorry. I meant external. In the following sense:
>
> The semantics of the program explicitly involve
> it in a larger external system, in a way that it
> might make sense to allow exceptions to propagate
> out to the external system.
>
> With readline history, it is clear that we must handle
> all conditions internally, so this condition is not met.
> Since E1-3 are also not met, we should not throw
> IO exceptions.
>
> -Yitz
>

The deadline for comments has passed and it seems like there isn't any
opposition to adding this to the library. The only thing that remains
is to make a decision on the exceptions vs. IO Bool thing. It seems
like most are in favor of throwing an exception.

For instances where an exception would be too intrusive, I don't see
how it would be too hard to write a wrapper function that would have
exactly the same monad requirements as the original function but
return an IO Bool instead of an error, e.g.

> tryReadHistory = catch readHistory (\e -> ...

So where do we go from here?

Alex


More information about the Libraries mailing list