Ticket #7667: Test1.hs

File Test1.hs, 360 bytes (added by andygill, 3 years ago)
Line 
1{-# LANGUAGE TemplateHaskell, TypeOperators #-}
2module Test1 where
3
4import Language.Haskell.TH
5import Language.Haskell.TH.Syntax
6import GHC.TypeLits
7
8instanceNat :: Q [Dec]
9instanceNat = do
10        let plus = mkNameG_tc "base" "GHC.TypeLits" "+"
11
12        let v = TySynInstD plus [LitT $ NumTyLit 1, LitT $ NumTyLit 2] (LitT $ NumTyLit 3)
13        return $ [v]
14