What should I use for effect handling?

action :: Effect1 -> Effect2 -> ...
action e1 e2 = ...

action' :: Effect2 -> Effect1 -> ...
action' e2 e1 = action e1 e2

This shows that two Reader effects can be swapped without changing the semantics, thus there is indeed a ground truth in this case. However, this does not extend to other effects such as state and exceptions.

…which then leads to “intriguing” combinations of types like ReaderT ... IO. But I think we can all agree that this thread is already way too long to discuss possible alternatives - that can be left for another thread, where we can all get a fresh start.

If it isn’t already obvious, I have major doubts about the scalability of effect systems - durable proof to the contrary would be helpful in convincing me otherwise. My parting comment for this thread is: do more searching - there may be something like a "precursor" to effect systems that can be used to build better ones, some technique or formalism that was formerly out of reach but now freely available to read.

If you’re interested, may you find what is needed to accomplish that task :-)

1 Like

Hmmm… OOP inheritance?