{-# OPTIONS_GHC -fglasgow-exts  #-}
import Control.Monad.ST
import Data.STRef

data Q s a chain = Node s a chain

data Z a  = Z  a
val :: STRef s a -> ST s a
val = undefined

s :: Q t (Z [Char]) t1 -> [Char]
s = undefined

r :: a -> STRef s a
r = undefined

class  Zork s a b | a-> b where
 huh:: STRef s (Q s a chain) ->  ST s ()

foo k  = do
 t <- val k

 let ref_b = r t

 b <- val ref_b
 let abc = s b
 huh ref_b
-- foo :: (Zork t (Z [Char]) ()) => STRef t (Q t (Z [Char]) t1) -> ST t () when let abc = s b is not commented and foo :: (Zork s a b) => STRef s (Q s a chain) -> ST s () when it is commented. Why?
