summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T10796a.hs
blob: 6c1ac8c78c32f8fc642d8075800efbd13431d630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE TemplateHaskell #-}
module T10796a where

import Data.Ratio
import Data.Set (Set, fromList)
import Language.Haskell.TH.Syntax (liftData)

-- Data instance with toConstr implemented using a variable,
-- not a data constructor
splicedSet :: Set Char
splicedSet = $(liftData (fromList "test"))

-- Infix data constructor
splicedRatio :: Ratio Int
splicedRatio = $(liftData (1 % 2 :: Ratio Int))