summaryrefslogtreecommitdiff
path: root/testsuite/tests/rep-poly/T14765.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rep-poly/T14765.hs')
-rw-r--r--testsuite/tests/rep-poly/T14765.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/rep-poly/T14765.hs b/testsuite/tests/rep-poly/T14765.hs
new file mode 100644
index 0000000000..b124252bb4
--- /dev/null
+++ b/testsuite/tests/rep-poly/T14765.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE MagicHash, PolyKinds, ExplicitForAll #-}
+
+module T14765 where
+
+import GHC.Exts
+
+fold :: forall rep a (r :: TYPE rep).
+ (r -> a -> Proxy# r -> r) -> (Proxy# r -> r) -> [a] -> r
+fold f k [] = k proxy#
+fold f k (x : xs) = fold f (f (k proxy#) x) xs