blob: daa3e34c6fb3ab2a4eaf08dae9d24e204aaf8f14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UnboxedTuples #-}
module T12407 where
import Language.Haskell.TH.Lib
import Language.Haskell.TH.Syntax
$(do let ubxTup = conT (unboxedTupleTypeName 2) `appT` conT ''Int
`appT` conT ''Int
x <- newName "x"
y <- newName "y"
[d| f :: $(ubxTup) -> $(ubxTup)
f $(conP (unboxedTupleDataName 2) [varP x, varP y])
= $(conE (unboxedTupleDataName 2) `appE` varE x
`appE` varE y)
|])
|