foldMapping in zio effect doesn't look good
tonivade opened this issue · comments
Currently there's a hack to wrap errors in a exception, but in any case I cannot use a MonadError because in the cases that there's a map in error for example mapError or bimap, i will need two different instances one for E and one for F, and there's no mapError method in MonadError and I don't know if it's even possible.
take a look this links about bimonad and bimonaderror
https://gist.github.com/LukaJCB/4440ad2bc351f1d8e98601f247ec4c02
But If I change the foldMap method to receive a Bimonaderror or Bimonaddefer or something like this, it will only be possible to transform it to other Bimonaderror instance, and currently is only possible to have bimonaderror instances of either, eitherT and ZIO it self, and the intention of this foldMap is to run it asynchronously in a Future, so, it's ok, I'm going to left ZIO foldMap alone, by now