polysemy-research / polysemy-zoo

:monkey::panda_face: Experimental, user-contributed effects and interpreters for polysemy
BSD 3-Clause "New" or "Revised" License
70 stars 21 forks source link

Validation effect #44

Closed jhenahan closed 7 months ago

jhenahan commented 5 years ago

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.

ocharles commented 5 years ago

This is an interesting one, as it's not currently expressible in polysemy due to have "non-standard" <*>.

KingoftheHomeless commented 5 years ago

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.

jhenahan commented 5 years ago

Agreed that the morally questionable instances make this sort of sticky, but there may be some entertaining behavior to pull into something more lawful.