blob: 9d865d08f61b3c1fd4c3aa7ef155797c77d2e10d (
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
|
{-# 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
|