- | not (isMetaTyVar tyvar) -- Skolems
- = return (TyVarTy tyvar)
-
- | otherwise -- Mutables
- = do { cts <- readMetaTyVar tyvar
- ; case cts of
- Flexi -> unbound_var_fn tyvar -- Unbound meta type variable
- Indirect ty -> zonkType unbound_var_fn ty }
+ = ASSERT( isTcTyVar tyvar )
+ case tcTyVarDetails tyvar of
+ SkolemTv {} -> return (TyVarTy tyvar)
+ FlatSkol ty -> zonkType unbound_var_fn ty
+ MetaTv _ ref -> do { cts <- readMutVar ref
+ ; case cts of
+ Flexi -> unbound_var_fn tyvar
+ Indirect ty -> zonkType unbound_var_fn ty }