blob: 348d916a2410e52a68bb62f65d5937ef2931c84a (
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
|
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE StaticPointers #-}
module Ppr054 where
import Data.Typeable
import GHC.StaticPtr
main = putStr $ unlines $ map show names
where
names =
[ staticPtrInfo $ static g
, staticPtrInfo $ (static id :: StaticPtr (Int -> Int))
, staticPtrInfo $ (p0 :: StaticPtr (Int -> Int))
, staticPtrInfo $ (static method :: StaticPtr (Char -> Int))
, staticPtrInfo $ (static t_field :: StaticPtr (T Int -> Int))
]
g :: Int -> Int
g = id
p0 :: Typeable a => StaticPtr (a -> a)
p0 = static (\x -> x)
data T a = T { t_field :: a }
deriving Typeable
class C1 a where
method :: a -> Int
instance C1 Char where
method = const 0
|