summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T9750.hs
blob: 59b8e60a31909e43083884e5ce10d9ecf6f7a9cd (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
26
27
28
29
30
31
32
33
34
35
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE FlexibleInstances      #-}
{-# LANGUAGE TypeFamilies           #-}
{-# LANGUAGE DataKinds              #-}
{-# LANGUAGE ScopedTypeVariables    #-}

module T9750 where

import GHC.TypeLits ( Symbol, KnownSymbol )

--------------------------------------------------------------------------------

data Meta = MetaCons Symbol
data M1 (c :: Meta) = M1

class Generic a where
  type Rep a :: *
  from  :: a -> Rep a

--------------------------------------------------------------------------------

data A = A1

instance Generic A where
  type Rep A = M1 ('MetaCons "test")
  from A1 = M1

class GShow' f where
  gshowsPrec' :: f -> ShowS

instance (KnownSymbol c) => GShow' (M1 ('MetaCons c)) where
  gshowsPrec' = error "urk"

instance GShow' A where
  gshowsPrec' = gshowsPrec' . from