summaryrefslogtreecommitdiff
path: root/testsuite/tests/mdo/should_compile/mdo004.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/mdo/should_compile/mdo004.hs')
-rw-r--r--testsuite/tests/mdo/should_compile/mdo004.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/mdo/should_compile/mdo004.hs b/testsuite/tests/mdo/should_compile/mdo004.hs
new file mode 100644
index 0000000000..544ee6cc66
--- /dev/null
+++ b/testsuite/tests/mdo/should_compile/mdo004.hs
@@ -0,0 +1,17 @@
+{-# OPTIONS -XRecursiveDo #-}
+
+-- test let bindings, polymorphism is ok provided they are not
+-- isolated in a recursive segment
+-- NB. this is not what Hugs does!
+
+module Main (main) where
+
+import Control.Monad.Fix
+
+t :: IO (Int, Int)
+t = mdo let l [] = 0
+ l (x:xs) = 1 + l xs
+ return (l "1", l [1,2,3])
+
+main :: IO ()
+main = t >>= print