You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I discussed with Adam on X, I opened this issue because I tried integrating my library raise4s with Ox. First, I tried to create a custom ErrorMode:
The above code randomly executes the two lambdas. It does not take into consideration the real execution of the body of the lambda. The issue is in the actual implementation of the race method:
The application f() in the case of a lambda defined in the context Raise[E] ?=> A is the Raise[E] ?=> A lambda itself and not the result of its execution.
So, to integrate the library raise4s with ox, I need to define a custom raceRaise method that uses the Either type:
defraceRaise[E, T](f1: T raises E, f2: T raises E):T raises E=
raceR(EitherMode[E])(List(() =>Raise.either(f1), () =>Raise.either(f2))).bind()
Feel free to let me know if you need any more information.
The text was updated successfully, but these errors were encountered:
As I discussed with Adam on X, I opened this issue because I tried integrating my library raise4s with Ox. First, I tried to create a custom
ErrorMode
:It works well with the
par
DSL. However, it doesn't respect the semantics of therace
DSL.The above code randomly executes the two lambdas. It does not take into consideration the real execution of the body of the lambda. The issue is in the actual implementation of the
race
method:The application
f()
in the case of a lambda defined in the contextRaise[E] ?=> A
is theRaise[E] ?=> A
lambda itself and not the result of its execution.So, to integrate the library
raise4s
withox
, I need to define a customraceRaise
method that uses theEither
type:Feel free to let me know if you need any more information.
The text was updated successfully, but these errors were encountered: