fpco / unliftio

The MonadUnliftIO typeclass for unlifting monads to IO
Other
151 stars 51 forks source link

Unnamed third law in class definition should be called "Invertibility" #26

Closed ghost closed 5 years ago

ghost commented 6 years ago

Isn't the law equivalent to "lifting must be invertible"?

snoyberg commented 6 years ago

I don't see the connection between the third law and invertibility, sorry.

ghost commented 6 years ago

Isn't the third law really the essence of UnliftIO? MonadUnliftIO takes m a into IO a, and MonadIO takes it back. In that sense, isn't this equivalent to invertibility?

snoyberg commented 6 years ago

Yes, sort of, but it's missing the essential distinguishing fact of the law: that the monad context is the same, and there are no missing monad state updates.

ghost commented 6 years ago

Isn't "monad context is the same" implied by invertibility? Maybe I don't fully understand.

snoyberg commented 5 years ago

Addressed in #41