nikita-volkov / refined

Refinement types with static checking
http://hackage.haskell.org/package/refined
MIT License
182 stars 32 forks source link

is the orphans module necessary? #60

Closed symbiont-sam-halliday closed 4 years ago

symbiont-sam-halliday commented 4 years ago

I am wondering why Aeson and QuickCheck instances are in a separate module instead of enabled via CPP, is there a design reason for the current layout?

e.g. it is possible to guard blocks of code that import and define the instances like so (here using transformers as an example, but equally applicable to Aeson / QuickCheck)

#ifdef VERSION_transformers
import           Control.Monad.Trans.Class (MonadTrans, lift)
#endif

https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/phases.html#standard-cpp-macros or define your own constant.

Would you welcome a PR removing the orphan modules and using CPP like this?

chessai commented 4 years ago

resolved in e9466fb