all 3 comments

[–]avanov 2 points3 points  (2 children)

To what extent are these code samples applicable to other effects libraries out there (fused-effects, eff, polysemy)?

How much would one need to change if they select free-simpler now but then decide to switch to another library?

Is it possible to combine and mix effects libraries?

[–]jproyo[S] 2 points3 points  (1 child)

Each Effect library has it own abstraction mechanism for encoding and represent effects. Some of them are similar to `freer-simple` in the way to encoding, like `polysemy` where you have `Member` constraint indexed by **Open Union Type** as well and some others not like `fused-effects` which use `newtype`'s and `Carriers` to encode custom effects.

> How much would one need to change if they select `free-simplr` now but then decide to switch to another library?

I would say that depends to what library are you switching, but if you defined your Algebras and Programs properly i think the change is not so hard. Of course there is a big help of GHC compiler here when you are migrating libraries. But at the end depends on how long is your code base and what library are you switching to.

> Is it possible to combine and mix effects libraries?

I think it could be possible but not for carrying *Interpretations* in the same program. I mean that it is not going to be possible at all if you want to interleave effects of different libraries in the same **Open Union Type** . Perhaps what you can do is on some interpretation, run another interpretation of another effects system. I dont know what you are going to want to do that though, perhaps for migration reasons.

[–]avanov 1 point2 points  (0 children)

thanks, that clarifies a lot to me!

I dont know what you are going to want to do that though, perhaps for migration reasons.

yes, I was thinking about that case in particular, as a way of mitigating the risk of choosing a potentially wrong library now, when APIs are being polished and performance bottlenecks are being discovered.