Commit f2123a38 authored by simonpj's avatar simonpj
Browse files

[project @ 2002-06-21 13:31:50 by simonpj]

Dont use the isomorphic-newtype deriving trick for recursive newtypes
parent 9cdd5cb9
......@@ -43,7 +43,7 @@ import RdrName ( RdrName )
import TyCon ( tyConTyVars, tyConDataCons, tyConArity, newTyConRep,
tyConTheta, maybeTyConSingleCon, isDataTyCon,
isEnumerationTyCon, TyCon
isEnumerationTyCon, isRecursiveTyCon, TyCon
)
import TcType ( TcType, ThetaType, mkTyVarTys, mkTyConApp, getClassPredTys_maybe,
isUnLiftedType, mkClassPred, tyVarsOfTypes, tcSplitFunTys,
......@@ -426,6 +426,10 @@ makeDerivEqns tycl_decls
&& n_args_to_keep >= 0 -- Well kinded:
-- eg not: newtype T a = T Int deriving( Monad )
&& eta_ok -- Eta reduction works
&& not (isRecursiveTyCon tycon) -- Does not work for recursive tycons:
-- newtype A = MkA [A]
-- Don't want
-- instance Eq [A] => Eq A !!
-- Check that eta reduction is OK
-- (a) the dropped-off args are identical
......
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