import TyCon
import Name hiding (varName)
-import OccName (varName)
import Module (moduleName, moduleNameString)
import RdrName
import BasicTypes
-- For generation of representation types
import TcEnv (tcLookupTyCon)
import TcRnMonad (TcM, newUnique)
-import TcMType (newMetaTyVar)
import HscTypes
import SrcLoc
import Outputable
import FastString
-import Data.List (splitAt)
-import Debug.Trace (trace)
-
#include "HsVersions.h"
\end{code}
-- Disabled
mkTyConGenericBinds :: TyCon -> LHsBinds RdrName
-mkTyConGenericBinds tycon =
+mkTyConGenericBinds _tycon =
{-
unitBag (L loc (mkFunBind (L loc from0_RDR) from0_matches))
`unionBags`
v1 <- tcLookupTyCon v1TyConName
plus <- tcLookupTyCon sumTyConName
times <- tcLookupTyCon prodTyConName
- noSel <- tcLookupTyCon noSelTyConName
- freshTy <- newMetaTyVar TauTv liftedTypeKind
let mkSum a b = mkTyConApp plus [a,b]
mkProd a b = mkTyConApp times [a,b]
conName_matches c = mkStringLHS . showPpr . nameOccName
. dataConName $ c
conFixity_matches c = [mkSimpleHsAlt nlWildPat (fixity c)]
- conIsRecord_matches c = [mkSimpleHsAlt nlWildPat (nlHsVar true_RDR)]
+ conIsRecord_matches _ = [mkSimpleHsAlt nlWildPat (nlHsVar true_RDR)]
-- TODO: check that this works
conIsTuple_matches c = [mkSimpleHsAlt nlWildPat
(nlHsApp (nlHsVar arityDataCon_RDR)
mkProd_E :: US -- Base for unique names
-> [RdrName] -- List of variables matched on the lhs
-> LHsExpr RdrName -- Resulting product expression
-mkProd_E us [] = mkM1_E (nlHsVar u1DataCon_RDR)
-mkProd_E us vars = mkM1_E (foldBal prod appVars)
+mkProd_E _ [] = mkM1_E (nlHsVar u1DataCon_RDR)
+mkProd_E _ vars = mkM1_E (foldBal prod appVars)
-- These M1s are meta-information for the constructor
where
appVars = map wrapArg_E vars
mkProd_P :: US -- Base for unique names
-> [RdrName] -- List of variables to match
-> LPat RdrName -- Resulting product pattern
-mkProd_P us [] = mkM1_P (nlNullaryConPat u1DataCon_RDR)
-mkProd_P us vars = mkM1_P (foldBal prod appVars)
+mkProd_P _ [] = mkM1_P (nlNullaryConPat u1DataCon_RDR)
+mkProd_P _ vars = mkM1_P (foldBal prod appVars)
-- These M1s are meta-information for the constructor
where
appVars = map wrapArg_P vars