Open union error type - Polysemy

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sridhar Ratnakumar

When using polysemy, do we have any special privilege to be able to straightforwardly define open union error types?

In other words, is MultiError easy to implement?

  :: Members '[SomeEffect, MultiError '[ParseError, RenderError]] m
  => m a


Using Either as a type operator makes the signature more palatable for nested Eithers: parse :: String -> Foo `Either` Bar `Either` Baz parse = undefined But writing Right (Left bar) is pretty janky. Can that be improved as well?
Georgi Lyubenov // googleson78

with Polysemy I've just used multiple Error effects instead

Torsten Schmits

with semantics being that you have to handle them all at the same time? or runError returning a tuple?

Georgi Lyubenov // googleson78

I guess you could use Bundle to stack Errors with some success