summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_compile/cg001.hs
blob: ad00a8f89c3dec3027e7d34b40cfb3656a677d0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE MagicHash #-}

module ShouldCompile where

import GHC.Exts

data STRef s a = STRef (MutVar# s a)

-- ghc 4.08 had a problem with returning a MutVar#.

from :: STRef s a -> MutVar# s a
from (STRef x) = x

to :: MutVar# s a -> STRef s a
to x = STRef x