Closed jhenahan closed 7 months ago
This is an interesting one, as it's not currently expressible in polysemy
due to have "non-standard" <*>
.
This strikes me as though it should be possible. It would require some wrangling, but you could look at how runError
is implemented, and then reimplement it using ValidateT
instead of ExceptT
.
Of course, I have some reservations about this since ValidateT
is not a lawful monad, but whatever.
Agreed that the morally questionable instances make this sort of sticky, but there may be some entertaining behavior to pull into something more lawful.
https://hackage.haskell.org/package/monad-validate-1.1.0.0/docs/Control-Monad-Validate.html
Just a note for me to come back to. Could be a neat effect.