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

-- test let bindings

module Main (main) where

import Control.Monad.Fix 

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

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