summaryrefslogtreecommitdiff
path: root/testsuite/tests/arrows/should_compile/T5283.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/arrows/should_compile/T5283.hs')
-rw-r--r--testsuite/tests/arrows/should_compile/T5283.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/arrows/should_compile/T5283.hs b/testsuite/tests/arrows/should_compile/T5283.hs
new file mode 100644
index 0000000000..2878208415
--- /dev/null
+++ b/testsuite/tests/arrows/should_compile/T5283.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE Arrows #-}
+-- Failed in ghci
+
+module T where
+
+import Prelude
+import Control.Arrow
+
+mapAC :: Arrow arr => Int -> arr (env, (b,())) c -> arr (env, ([b],())) [c]
+mapAC n farr = go 0
+ where
+ go i | i == n = arr (\(_env, ([], ())) -> [])
+ | otherwise = proc ~(env, (b : bs, ())) ->
+ do c <- farr -< (env, (b, ()))
+ cs <- go (i+1) -< (env, (bs, ()))
+ returnA -< c : cs
+
+t :: Arrow arr => arr [a] [a]
+t = proc ys ->
+ (| (mapAC 3) (\y -> returnA -< y) |) ys