summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_compile/T10931.hs
blob: 44e5865177eee2476b9d6e3ff46ac408353c66a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RankNTypes #-}

{-# OPTIONS_GHC -Wall #-}

module T10931 ( BugC(..) ) where

data IdT f a = IdC (f a)

class ( m ~ Outer m (Inner m) ) => BugC (m :: * -> *) where
    type Inner m :: * -> *
    type Outer m :: (* -> *) -> * -> *

    bug :: ( forall n. ( n ~ Outer n (Inner n)
                       , Outer n ~ Outer m
                       )
            => Inner n a)
        -> m a

instance BugC (IdT m) where
    type Inner (IdT m) = m
    type Outer (IdT _) = IdT

    bug f = IdC f