fvilante / NextRobot

The next robot framework
0 stars 0 forks source link

Verify trade-off of Unsafe Left E #15

Open fvilante opened 4 years ago

fvilante commented 4 years ago

by design:

Monads with E type like Future<E,A> - are unsafe for throws. Except if E is Error like in Future<Error,A> in this case it is safe. This decision is for performance, to avoid put all program function's evaluation insight a try catch. Although I didn't perform any perf analysis so far.

Other possibility of design is to make safety against throws in all scenarios and assume the cost of eventually try catch block every-thing. I don't know what are the trade-offs implied. Verify.

https://github.com/fvilante/NextRobot/issues/14#issue-528732096

fvilante commented 4 years ago

PROBLEM: All are unsafe or all are safe. Because if I map a Future<E,A> to Future<Error,A> I can't garantee that a Try-catch-block was performed by client.