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
InterposeC intercepts requests for an effect without extending the signature; instead, it projects out and handles requests for that effect, passing any others along.
InterpretC and other typical carriers extend the signature at the left, and handle any requests for their signature, passing any others along.
Both extend the monad stack with another layer.
From the perspective of code run inside the monad, it makes no difference whether the available effects are A :+: B :+: C and B is interposed, or B :+: A :+: B :+: C and requests for B are intercepted by the leftmost carrier for B. (It is technically possible to observe the difference since you can constrain the signature and pattern match on the effect sum with a carrier, but there’s no point to doing so and so you simply don’t.)
Therefore, interposition as currently implemented is redundant: you could just have a carrier, either using runInterpret or manually defined, which extends the signature. Doing so would be quite useful since InterposeC is inefficient and complicated, and it would also allow us to remove prj altogether.
The text was updated successfully, but these errors were encountered:
InterposeC
intercepts requests for an effect without extending the signature; instead, it projects out and handles requests for that effect, passing any others along.InterpretC
and other typical carriers extend the signature at the left, and handle any requests for their signature, passing any others along.Both extend the monad stack with another layer.
From the perspective of code run inside the monad, it makes no difference whether the available effects are
A :+: B :+: C
andB
is interposed, orB :+: A :+: B :+: C
and requests forB
are intercepted by the leftmost carrier forB
. (It is technically possible to observe the difference since you can constrain the signature and pattern match on the effect sum with a carrier, but there’s no point to doing so and so you simply don’t.)Therefore, interposition as currently implemented is redundant: you could just have a carrier, either using
runInterpret
or manually defined, which extends the signature. Doing so would be quite useful sinceInterposeC
is inefficient and complicated, and it would also allow us to removeprj
altogether.The text was updated successfully, but these errors were encountered: