Do not use loop breaker modules with 2.0x
module TcGRHSs ( tcGRHSsAndBinds ) where
IMP_Ubiq(){-uitous-}
module TcGRHSs ( tcGRHSsAndBinds ) where
IMP_Ubiq(){-uitous-}
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ <= 201
IMPORT_DELOOPER(TcLoop) -- for paranoia checking
IMPORT_DELOOPER(TcLoop) -- for paranoia checking
import HsSyn ( GRHSsAndBinds(..), GRHS(..), MonoBinds, Stmt, DoOrListComp(..),
HsExpr, HsBinds(..), InPat, OutPat, Sig, Fake )
import HsSyn ( GRHSsAndBinds(..), GRHS(..), MonoBinds, Stmt, DoOrListComp(..),
HsExpr, HsBinds(..), InPat, OutPat, Sig, Fake )
import RdrHsSyn ( RdrName(..), varQual, varUnqual, mkOpApp,
SYN_IE(RdrNameMonoBinds), SYN_IE(RdrNameHsExpr), SYN_IE(RdrNamePat)
)
import RdrHsSyn ( RdrName(..), varQual, varUnqual, mkOpApp,
SYN_IE(RdrNameMonoBinds), SYN_IE(RdrNameHsExpr), SYN_IE(RdrNamePat)
)
--- import RnHsSyn ( RenamedFixityDecl(..) )
-
import Id ( GenId, isNullaryDataCon, dataConTag,
dataConRawArgTys, fIRST_TAG,
isDataCon, SYN_IE(DataCon), SYN_IE(ConTag),
import Id ( GenId, isNullaryDataCon, dataConTag,
dataConRawArgTys, fIRST_TAG,
isDataCon, SYN_IE(DataCon), SYN_IE(ConTag),
import PrimOp ( PrimOp(..) )
import PrelInfo -- Lots of RdrNames
import SrcLoc ( mkGeneratedSrcLoc, SrcLoc )
import PrimOp ( PrimOp(..) )
import PrelInfo -- Lots of RdrNames
import SrcLoc ( mkGeneratedSrcLoc, SrcLoc )
-import TyCon ( TyCon, tyConDataCons, isEnumerationTyCon, maybeTyConSingleCon )
+import TyCon ( TyCon, isNewTyCon, tyConDataCons, isEnumerationTyCon, maybeTyConSingleCon )
import Type ( eqTy, isPrimType, SYN_IE(Type) )
import TysPrim ( charPrimTy, intPrimTy, wordPrimTy, addrPrimTy,
floatPrimTy, doublePrimTy
import Type ( eqTy, isPrimType, SYN_IE(Type) )
import TysPrim ( charPrimTy, intPrimTy, wordPrimTy, addrPrimTy,
floatPrimTy, doublePrimTy
gen_Eq_binds tycon
= let
tycon_loc = getSrcLoc tycon
gen_Eq_binds tycon
= let
tycon_loc = getSrcLoc tycon
- (nullary_cons, nonnullary_cons)
- = partition isNullaryDataCon (tyConDataCons tycon)
+ (nullary_cons, nonnullary_cons)
+ | isNewTyCon tycon = ([], tyConDataCons tycon)
+ | otherwise = partition isNullaryDataCon (tyConDataCons tycon)
rest
= if (null nullary_cons) then
rest
= if (null nullary_cons) then
(cmp_tags_Expr ltH_Int_RDR ah_RDR bh_RDR ltTag_Expr gtTag_Expr)))
(nullary_cons, nonnullary_cons)
(cmp_tags_Expr ltH_Int_RDR ah_RDR bh_RDR ltTag_Expr gtTag_Expr)))
(nullary_cons, nonnullary_cons)
- = partition isNullaryDataCon (tyConDataCons tycon)
+ | isNewTyCon tycon = ([], tyConDataCons tycon)
+ | otherwise = partition isNullaryDataCon (tyConDataCons tycon)
cmp_eq
= mk_FunMonoBind tycon_loc cmp_eq_RDR (map pats_etc nonnullary_cons ++
cmp_eq
= mk_FunMonoBind tycon_loc cmp_eq_RDR (map pats_etc nonnullary_cons ++