diff options
Diffstat (limited to 'testsuite/tests/printer/Ppr054.hs')
-rw-r--r-- | testsuite/tests/printer/Ppr054.hs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/tests/printer/Ppr054.hs b/testsuite/tests/printer/Ppr054.hs new file mode 100644 index 0000000000..348d916a24 --- /dev/null +++ b/testsuite/tests/printer/Ppr054.hs @@ -0,0 +1,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 |