Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

Consider replacing ClassyPrelude with RIO (revisited) #11

Closed
akhra opened this issue Mar 12, 2018 · 7 comments
Closed

Consider replacing ClassyPrelude with RIO (revisited) #11

akhra opened this issue Mar 12, 2018 · 7 comments

Comments

@akhra
Copy link
Contributor

akhra commented Mar 12, 2018

In the wake of #10, we now have:

Okay, what's MagicbaneApp?

newtype MagicbaneApp β α = MagicbaneApp {
 unMagicbaneApp ∷ ReaderT β IO α }

It's just a ReaderT over IO!

This is exactly the RIO monad:

newtype RIO env a = RIO { unRIO :: ReaderT env IO a }

It would be nice to unify these!

@akhra akhra changed the title Consider replacing ClassyPrelude with RIO Consider replacing ClassyPrelude with RIO (revisited) Mar 12, 2018
@valpackett
Copy link
Owner

Yeah, I thought about this, but the dependency…

(And it's not exactly the RIO monad ­— MagicbaneApp derives many many more typeclasses! Including MonadMask which is necessary for monad-metrics.)

Does the rio library even define anything on RIO specifically? As far as I can tell, it mostly reexports functions that are defined on various typeclasses.

@akhra
Copy link
Contributor Author

akhra commented Mar 12, 2018

Hm, good point. This might be something worth discussing directly with @snoyberg. There's a relevant open issue: commercialhaskell/rio#38

@valpackett
Copy link
Owner

hah, I saw this issue (but didn't realize you posted in it)

I also derive MonadBase IO, MonadBaseControl IO for various things. In general, it seems that RIO is aimed at minimal modern clean applications. What I'm going for here is maximum compatibility with whatever crap you can plug into a monad :D

@snoyberg
Copy link

It may be reasonable to define a rio-orphans companion package that has all of those missing instances.

@akhra
Copy link
Contributor Author

akhra commented Mar 14, 2018

^ This got done. RIO now has all the instances Magicbane does, plus bonus MonadResource and PrimMonad.

@valpackett
Copy link
Owner

Now using RIO, @tejon please test :)

@akhra
Copy link
Contributor Author

akhra commented Jul 2, 2018

Smooth transition, everything looks great!

valpackett added a commit that referenced this issue Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants