Proposal: Num instance for tuples

Henning Thielemann lemming at henning-thielemann.de
Thu Oct 18 12:07:08 CEST 2012


On Thu, 18 Oct 2012, Twan van Laarhoven wrote:

> One piece of utility code that I find myself writing over and over again is 
> the pointwise Num instance for tuples, i.e.

For my taste, writing

   2 :: (Int, Integer)

   abs (x,y)

should yield a compiler error and the compiler should not try to interpret 
it in some way. For the cases where you need these instances I suggest you 
use custom data types.



More information about the Libraries mailing list