summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_run/TcTypeSymbolSimpleRun.hs
blob: 518d4e523cd0a561dfbca396d6f1fef3e421f6dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE DataKinds, TypeOperators, TypeFamilies #-}
module Main(main) where
import GHC.TypeLits
import Data.Proxy

--------------------------------------------------------------------------------
-- Test top-reactions

tappend :: Proxy (AppendSymbol x y) -> Proxy x -> Proxy y
tappend _ _ = Proxy

tappend2 :: Proxy (AppendSymbol x y) -> (Proxy x, Proxy y)
tappend2 _ = (Proxy, Proxy)

main :: IO ()
main = print [ symbolVal (tappend (Proxy :: Proxy "abc") (Proxy :: Proxy "ab"))
               == "c"
             , let (p, q) = tappend2 (Proxy :: Proxy "")
               in (symbolVal p, symbolVal q) == ("", "")
             ]
  where
  sh x = show (natVal x)