summaryrefslogtreecommitdiff
path: root/testsuite/tests/arrows
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-04-05 12:34:37 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-04-05 12:34:37 +0100
commitac8464ba51417e21f41d7b5fcfbf2124fc6179b9 (patch)
tree6beb85edd8bfadb3b6a0580944436054af42c227 /testsuite/tests/arrows
parentf90a4e1abc80df73d4d6c1532ed8b6bc83f69142 (diff)
downloadhaskell-ac8464ba51417e21f41d7b5fcfbf2124fc6179b9.tar.gz
Test Trac #5022
Diffstat (limited to 'testsuite/tests/arrows')
-rw-r--r--testsuite/tests/arrows/should_compile/T5022.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/arrows/should_compile/T5022.hs b/testsuite/tests/arrows/should_compile/T5022.hs
new file mode 100644
index 0000000000..d0213397e3
--- /dev/null
+++ b/testsuite/tests/arrows/should_compile/T5022.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE Arrows #-}
+module T5022 ( pIterate ) where
+
+import Prelude hiding ( init )
+
+returnA :: b -> b
+returnA = id
+
+------------
+newtype State s a = State { unState :: [a] }
+
+------------
+pIterate :: a -> [a]
+pIterate =
+ proc x -> do
+ rec
+ as <- unState -< s
+ let s = State (x:as)
+ returnA -< as