summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc105.hs
blob: b7b8df2fad08e038c2e6cbae942294b7a8f1d255 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}

module ShouldCompile where

import Control.Monad.ST
import Data.STRef

-- (Modified now that we don't have result type signatures)

f:: forall s. ST s Int
f = do v <- newSTRef 5
       let g :: ST s Int
             -- ^ should be in scope
           g = readSTRef v
       g