summaryrefslogtreecommitdiff
path: root/testsuite/tests/arrows/should_compile/arrowdo1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/arrows/should_compile/arrowdo1.hs')
-rw-r--r--testsuite/tests/arrows/should_compile/arrowdo1.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/arrows/should_compile/arrowdo1.hs b/testsuite/tests/arrows/should_compile/arrowdo1.hs
new file mode 100644
index 0000000000..b70eedd460
--- /dev/null
+++ b/testsuite/tests/arrows/should_compile/arrowdo1.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE Arrows #-}
+
+module ShouldCompile where
+
+import Control.Arrow
+
+f :: Arrow a => a (Int,Int,Int) Int
+f = proc (x,y,z) -> returnA -< x+y
+
+g :: Arrow a => Int -> a Int Int
+g x = proc y -> returnA -< x*y
+
+h :: Arrow a => Int -> a (Int,Int) Int
+h x = proc (y,z) -> do
+ a <- f -< (x,y,3)
+ b <- g (2+x) -< y+a
+ returnA -< a*b+z