Closed solvingj closed 6 years ago
Can you please provide an explanation as to how this bit of code works? It's unclear to me how the Eff gets matched to the "Set..." types like SetException.
Eff
SetException
https://github.com/nessos/Eff/blob/master/src/Eff.Core/EffExecutor.cs#L30
public static async Task<TResult> Run<TResult>(this Eff<TResult> eff, IEffectHandler handler) { ... var result = default(TResult); var done = false; while (!done) { switch (eff) { case SetException<TResult> setException: await handler.Handle(setException); break;
Can you please provide an explanation as to how this bit of code works? It's unclear to me how the
Eff
gets matched to the "Set..." types likeSetException
.https://github.com/nessos/Eff/blob/master/src/Eff.Core/EffExecutor.cs#L30