summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T2448.hs
blob: 806df3ff4c3c7570b394a0269af79169cc989402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE TypeFamilies, UndecidableInstances #-}

module T2448 where

-- Demonstrates a bug in propagating type equality constraints

class VectorSpace v where
  type Scalar v :: *

class VectorSpace v => InnerSpace v

instance (VectorSpace u,VectorSpace v, Scalar u ~ Scalar v) => 
  VectorSpace (u,v) 
  where
  type Scalar (u,v) = Scalar u

instance (InnerSpace u,InnerSpace v, Scalar u ~ Scalar v) => InnerSpace (u,v)