summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/TH_namePackage.hs
blob: 7c4a541ec96c7057e06cf7c2fb789588502bf5d9 (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 Main where

import Language.Haskell.TH

eitherName, fooName, moduleFooName :: Name
eitherName = ''Either
fooName = mkName "foo"
moduleFooName = mkName "Module.foo"

main :: IO ()
main = do
  print $ nameBase eitherName
  print $ nameBase fooName
  print $ nameBase moduleFooName

  print $ nameModule eitherName
  print $ nameModule fooName
  print $ nameModule moduleFooName

  print $ namePackage eitherName
  print $ namePackage fooName
  print $ namePackage moduleFooName