summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_run/tcrun001.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_run/tcrun001.hs')
-rw-r--r--testsuite/tests/typecheck/should_run/tcrun001.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_run/tcrun001.hs b/testsuite/tests/typecheck/should_run/tcrun001.hs
new file mode 100644
index 0000000000..209ca3fe00
--- /dev/null
+++ b/testsuite/tests/typecheck/should_run/tcrun001.hs
@@ -0,0 +1,16 @@
+-- !! Test for (->) instances
+
+module Main where
+
+class Flob k where
+ twice :: k a a -> k a a
+
+instance Flob (->) where
+ twice f = f . f
+
+inc :: Int -> Int
+inc x = x+1
+
+main = print (twice inc 2)
+
+