kowainik / eio

🎯 IO with Exceptions tracked on the type-level
Mozilla Public License 2.0
58 stars 2 forks source link

Stop exporting constructor for EIO #15

Open JonathanLorimer opened 3 years ago

JonathanLorimer commented 3 years ago

I think that allowing the user to wrap an IO action in EIO can lead to confusing type errors. I propose that we instead introduce some functions such as these:

unsafeLiftIO :: IO a -> EIO '[] a
unsafeLiftIO = EIO

tryLiftIO :: (Exception e) => IO a -> EIO '[] (Either e a)
tryLiftIO = EIO . try