summaryrefslogtreecommitdiff
path: root/testsuite/tests/rep-poly/RepPolyTuple2.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rep-poly/RepPolyTuple2.hs')
-rw-r--r--testsuite/tests/rep-poly/RepPolyTuple2.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/rep-poly/RepPolyTuple2.hs b/testsuite/tests/rep-poly/RepPolyTuple2.hs
new file mode 100644
index 0000000000..43e590587b
--- /dev/null
+++ b/testsuite/tests/rep-poly/RepPolyTuple2.hs
@@ -0,0 +1,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)