summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T5362.hs
blob: 4a1e67fb4a0621a341d341b4da2c630a0ed92b55 (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 #-}

module T5362() where

import System.IO
import Language.Haskell.TH

$(
     do fName <- newName "f"
        gName <- newName "g"
        let gExp = varE gName

        sdf <- sigD fName [t| () |]
        sdg <- sigD gName [t| () |]
        fdf <- funD fName [clause [] (normalB [| undefined $gExp |]) []]
        fdg <- funD gName [clause [] (normalB [| undefined       |]) []]
        let ds = [sdf, fdf, sdg, fdg]
        runIO $ do { putStrLn (pprint ds); hFlush stdout }
        return ds
     )