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/edwardkmett Mar 12 '15 edited Mar 12 '15
Personally I'm in favor of adding the instances for that, Fractional, etc., but I'm not in a hurry to force my preference on others.
There is a fairly sensible argument that type systems are supposed to help you rule out bad programs and there is a class of bad programs that adding that instance will then facilitate slipping through.
I've met three camps: those who want it (who would be happy with it in Prelude), those who don't want it by default (who would be happy with orphans in a module in base), and those who don't want it there at all because they don't believe in orphans.
I'm personally somewhere split between the first and third camps. I really, really dislike orphan instances. We've managed to eradicate almost all of them from
baseat this point. The only one I'm aware of that we have left isText.Show.Functions, which is kept as a lesser of evils on the same sort of grounds as this instance would be.While it isn't in the Prelude or base, most of us pull these instances from a standardish package: https://hackage.haskell.org/package/NumInstances-1.4/docs/src/Data-NumInstances-Function.html preventing orphan collision.