summaryrefslogtreecommitdiff
path: root/testsuite/tests/numeric/should_compile/T23019.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/numeric/should_compile/T23019.hs')
-rw-r--r--testsuite/tests/numeric/should_compile/T23019.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/numeric/should_compile/T23019.hs b/testsuite/tests/numeric/should_compile/T23019.hs
new file mode 100644
index 0000000000..6b3e3d92ba
--- /dev/null
+++ b/testsuite/tests/numeric/should_compile/T23019.hs
@@ -0,0 +1,21 @@
+module T23019
+ (
+ eexponent
+ ) where
+
+-- spine lazy, value strict list of doubles
+data List
+ = Nil
+ | {-# UNPACK #-} !Double :! List
+
+infixr 5 :!
+
+newtype TowerDouble = Tower { getTower :: List }
+
+primal :: TowerDouble -> Double
+primal (Tower (x:!_)) = x
+primal _ = 0
+
+eexponent :: TowerDouble -> Int
+eexponent = exponent . primal
+