Commit 49ccdd84 authored by sof's avatar sof

[project @ 1997-08-25 22:28:37 by sof]

new function: zonkSigTyVar
parent da85d66a
......@@ -27,7 +27,7 @@ module TcType (
tcInstType, tcInstSigType, tcInstTcType, tcInstSigTcType,
tcInstTheta, tcInstId,
zonkTcTyVars, zonkSigTyVar,
......@@ -410,6 +410,16 @@ zonkTcTyVar tyvar
BoundTo other -> zonkTcType other
other -> returnNF_Tc (TyVarTy tyvar)
-- Signature type variables only get bound to each other,
-- never to a type
zonkSigTyVar :: TcTyVar s -> NF_TcM s (TcTyVar s)
zonkSigTyVar tyvar
= tcReadTyVar tyvar `thenNF_Tc` \ maybe_ty ->
case maybe_ty of
BoundTo ty@(TyVarTy tyvar') -> returnNF_Tc tyvar' -- tcReadTyVar never returns a bound tyvar
BoundTo other -> panic "zonkSigTyVar" -- Should only be bound to another tyvar
other -> returnNF_Tc tyvar
zonkTcType :: TcType s -> NF_TcM s (TcType s)
zonkTcType (TyVarTy tyvar) = zonkTcTyVar tyvar
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment