summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T9064.hs
blob: 3451e2e77ead69c083670e0c5adee77b7d9f8c10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE TemplateHaskell, DefaultSignatures #-}

module T9064 where

import Language.Haskell.TH
import System.IO

$( [d| class C a where
         foo :: a -> String
         default foo :: Show a => a -> String
         foo = show |] )

data Bar = Bar deriving Show
instance C Bar

x :: Bar -> String
x = foo

$( do info <- reify ''C
      runIO $ do
        putStrLn $ pprint info
        hFlush stdout
      return [] )