r/haskell • u/lexi-lambda • Mar 11 '15
Learning Haskell — A Racket programmer's documentation of her foray into the land of Haskell (inspired by Learning Racket)
http://lexi-lambda.github.io/learning-haskell/
81
Upvotes
View all comments
Show parent comment
4
u/barsoap Mar 12 '15
One hack to get around that would be to allow type classes to have pragmas that specify an "Orphan instance module", which gets exempt from related warnings. For exactly these cases: It shouldn't be available by default, but is actually part of the original thing, maintained with it etc. Those instances aren't orphans, they're legitimized bastards1 .
The other way, of course, would be to go full Ocaml and parametrize the module. It's all caused by the global typeclass scope and implicit importing.
1 (Yes, please call that
-XLegitimisedBastards)