summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/indexed-types/should_compile/Class1.hs
blob: 4e58e13d584c36196e1ba069bf590dcf1630a914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# LANGUAGE TypeFamilies, FlexibleContexts #-}

-- Results in context reduction stack overflow

module Class1 where

class C a where
  foo :: a x -> a y

class C (T a) => D a where
  type T a :: * -> *

  bar :: a -> T a x -> T a y

instance C Maybe where
  foo Nothing = Nothing

instance D () where
  type T () = Maybe

  bar x t = foo t