summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/mdo/should_fail/mdofail001.hs
blob: fe8f95e766a38a4246f66983392658a4473b605e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# OPTIONS -XRecursiveDo #-}

-- let bindings are monomorphic if used prior to their definition

module Main (main) where

import Control.Monad.Fix 

t :: IO (Int, Int)
t = mdo x <- return (l "1", l [1,2,3])
        let l [] = 0
            l (x:xs) = 1 + l xs
        return x

main :: IO ()
main = t >>= print