summaryrefslogtreecommitdiff
path: root/testsuite/tests/rep-poly/RepPolyTuple2.hs
blob: 43e590587b0079dc2268a51efc45ce4b2aa0fa30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UnboxedTuples #-}

module RepPolyTuple2 where

import GHC.Exts

type RR :: RuntimeRep
type family RR where { RR = FloatRep }
type F :: TYPE RR
type family F where { F = Float# }

{-# NOINLINE expensive #-}
expensive :: Float -> Float
expensive x = cos x ** 123.45

tup x = (# , #) @LiftedRep @RR (expensive x)