diff options
Diffstat (limited to 'testsuite/tests/codeGen/should_compile/T18397.hs')
-rw-r--r-- | testsuite/tests/codeGen/should_compile/T18397.hs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_compile/T18397.hs b/testsuite/tests/codeGen/should_compile/T18397.hs new file mode 100644 index 0000000000..6941b811ba --- /dev/null +++ b/testsuite/tests/codeGen/should_compile/T18397.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE UnboxedTuples #-} +module T18397 where + +import GHC.Exts +import GHC.ST + +data MutableArray s a = MutableArray (MutableArray# s a) + +runArray# + :: (forall s. ST s (MutableArray s a)) + -> Array# a +runArray# m = case runRW# $ \s -> + case unST m s of { (# s', MutableArray mary# #) -> + unsafeFreezeArray# mary# s'} of (# _, ary# #) -> ary# + +unST :: ST s a -> State# s -> (# State# s, a #) +unST (ST f) = f + |