blob: 6ae6e12c506d9ec10950dce5eebf0596f2cd277e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
{-# LANGUAGE TypeFamilies, UndecidableInstances #-}
{-# OPTIONS_GHC -Wnot #-}
module Main where
-- See http://article.gmane.org/gmane.comp.lang.haskell.general/16796
-- and Trac #2985
instance (Num a, Num b, a ~ b) => Num (a,b) where
(x,y) * (u,v) = (x*u-y*v, x*v+y*u)
test1 = (1,1) * (2,2)
main = print test1
|