serokell / universum

:milky_way: Prelude written in @Serokell
MIT License
174 stars 26 forks source link

Re-export `hoistMaybe` from `transformers` #253

Open dcastro opened 2 years ago

dcastro commented 2 years ago

At the moment, we're defining hoistMaybe in Universum.Monad.Trans.

However, transformers also introduced a hoistMaybe function in 0.6.0.0. We should just re-export it.

We shouldn't do this now though. Even recent LTSs are still using older versions of transformers. LTS 18.28 uses transformers-0.5.6.2. Let's do this when transformers >= 0.6.0.0 gains widespread adoption.

treeowl commented 2 years ago

Why not use a bit of CPP?

dcastro commented 2 years ago

Why not use a bit of CPP?

Hmm I guess using CPP to either re-export hoistMaybe or define it from scratch would help avoid issues when a user has both Control.Monad.Trans.Maybe.hoistMaybe and Universum.hoistMaybe in scope at the same time.

Yup, we could do that in the interim, and then delete it and re-export transformer's when it gains widespread adoption, good idea!

treeowl commented 2 years ago

Cool. Do you know of any tools that try to point out (or even remove) MIN_VERSION macros that Cabal bounds make redundant? I probably wouldn't want negated invocations removed.

dcastro commented 2 years ago

I'm not aware of any, no :/