On 18/10/12 11:58, Twan van Laarhoven wrote:
Dear list,
One piece of utility code that I find myself writing over and over again is the
pointwise Num instance for tuples, i.e.
Discussion period: 2 weeks, ends 2012-11-01.
The discussion period is over, and it seems that most people are again
I use these instances and similar ones from NumInstances [1] quite a bit. I
also frequently use another pattern for applicative functors, via
applicative-numbers [2]. I don't mind pulling these instances from a
package, though they are orphans.
It does trouble me a bit that the two patterns overla
On 18/10/2012 11:07, Henning Thielemann wrote:
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 co
On Thu, Oct 18, 2012 at 11:58:17AM +0200, Twan van Laarhoven wrote:
> Dear list,
>
>
> One piece of utility code that I find myself writing over and over
> again is the pointwise Num instance for tuples, i.e.
>
> instance (Num a, Num b) => Num (a,b) where
> fromInteger x = (fromInteg
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 in
Dear list,
One piece of utility code that I find myself writing over and over again is the
pointwise Num instance for tuples, i.e.
instance (Num a, Num b) => Num (a,b) where
fromInteger x = (fromInteger x, fromInteger x)
(a,b) + (a',b') = (a + a', b + b')
(a,b) - (