summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_run/T2985.hs
blob: 161021c6df31c3180748e985423bd2c3595c4990 (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 #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