Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
f2123a38
Commit
f2123a38
authored
Jun 21, 2002
by
simonpj
Browse files
[project @ 2002-06-21 13:31:50 by simonpj]
Dont use the isomorphic-newtype deriving trick for recursive newtypes
parent
9cdd5cb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/typecheck/TcDeriv.lhs
View file @
f2123a38
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment