summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/mdo/should_compile/mdo004.hs
blob: 544ee6cc669ff8355d901931e0aa245697210c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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