Re: Add further conversions between data-directed and code-directed programming idioms Lassi Kortela 07 Jun 2020 12:18 UTC

> It's not yet clear to me whether it is a good idea (Lassi would say
> whether it is "The Right Thing") to transform Posix signals into
> exceptions

Sounds quite dangerous. Signals and threads go together like diet coke
and mentos :)

As one pitfall, there must be a decision in which thread the signal
handler is run and whether or not other threads are stopped. Some OSes
even have a separate signal stack. I'm sure there are many more footguns
involving I/O interruptions, continuations and FFI for starters.

> but I agree with you that catching every exception by
> default can be very dangerous.

+1

> Anyway, for the moment being, I would, therefore, revise my proposal to:
>
> (either <thunk> <pred>)
>
> This can be used as in: (either read read-error?)

LGTM