testsuite: Add tests from #11982
[ghc.git] / testsuite / tests / typecheck / should_compile / T11982b.hs
1 {-# LANGUAGE RankNTypes #-}
2 {-# LANGUAGE ApplicativeDo #-}
3 module Main where
4 import Control.Concurrent.MVar
5
6 type Locker = forall a. IO a -> IO a
7
8 main :: IO ()
9 main = do
10 line <- getLine
11 lock <- newMVar ()
12 let locker :: Locker
13 locker = withMVar lock . const
14 f line locker
15
16 f :: String -> Locker -> IO ()
17 f line locker = locker $ putStrLn line