summaryrefslogtreecommitdiff
path: root/testsuite/tests/printer/T13942.hs
blob: 8899e1c58d8ee8b419847d58b2995d7a2b0ccdc9 (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
36
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-}
module T13942 where

$([d| f :: Either Int (Int -> Int)
      f = undefined
    |])

{-

Note: to debug

~/inplace/bin/ghc-stage2 --interactive
load the following
--------------------------------------
import Language.Haskell.TH

foo :: IO ()
foo = do
  r <- runQ ([d| f :: Either Int (Int -> Int)
                 f = undefined
             |])
  print r

----------------------------------------
foo
[SigD f_0 (AppT (AppT (ConT Data.Either.Either) (ConT GHC.Types.Int)) (AppT (AppT ArrowT (ConT GHC.Types.Int)) (ConT GHC.Types.Int)))
,ValD (VarP f_0) (NormalB (VarE GHC.Err.undefined)) []]

[SigD f_0
  (AppT (AppT (ConT Data.Either.Either)
              (ConT GHC.Types.Int))
        (AppT (AppT ArrowT
                    (ConT GHC.Types.Int))
              (ConT GHC.Types.Int)))
-}