Commit b08a533d authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan Committed by Edward Z. Yang

Fix DeriveGeneric for types with same OccName (#10487)

Summary:
DeriveGeneric generates some data types (for data type constructors and for
selectors of those constructors) and instances for those types. This patch
changes name generation for these new types to make it working with data types
with same names imported from different modules and with data types with same
names imported from same modules(using module imports).

Bonus content:

- Some refactoring in `TcGenGenerics.metaTyConsToDerivStuff` to remove some
  redundant partial function applications and to remove a duplicated function.
- Remove some unused names from `OccName`. (those were used for an old
  implementation of `DeriveGeneric`)

Reviewers: kosmikus, simonpj, dreixel, ezyang, bgamari, austin

Reviewed By: bgamari, austin

Subscribers: ezyang, thomie

Differential Revision: https://phabricator.haskell.org/D1081

GHC Trac Issues: #10487
parent 2440e3c6
......@@ -60,7 +60,7 @@ module OccName (
mkDerivedTyConOcc, mkNewTyCoOcc, mkClassOpAuxOcc,
mkCon2TagOcc, mkTag2ConOcc, mkMaxTagOcc,
mkClassDataConOcc, mkDictOcc, mkIPOcc,
mkSpecOcc, mkForeignExportOcc, mkRepEqOcc, mkGenOcc1, mkGenOcc2,
mkSpecOcc, mkForeignExportOcc, mkRepEqOcc,
mkGenD, mkGenR, mkGen1R, mkGenRCo, mkGenC, mkGenS,
mkDataTOcc, mkDataCOcc, mkDataConWorkerOcc,
mkSuperDictSelOcc, mkSuperDictAuxOcc,
......@@ -109,6 +109,7 @@ import FastString
import Outputable
import Lexeme
import Binary
import Module
import Data.Char
import Data.Data
......@@ -602,8 +603,8 @@ mkDataConWrapperOcc, mkWorkerOcc,
mkMatcherOcc, mkBuilderOcc,
mkDefaultMethodOcc,
mkGenDefMethodOcc, mkDerivedTyConOcc, mkClassDataConOcc, mkDictOcc,
mkIPOcc, mkSpecOcc, mkForeignExportOcc, mkRepEqOcc, mkGenOcc1, mkGenOcc2,
mkGenD, mkGenR, mkGen1R, mkGenRCo,
mkIPOcc, mkSpecOcc, mkForeignExportOcc, mkRepEqOcc,
mkGenR, mkGen1R, mkGenRCo,
mkDataTOcc, mkDataCOcc, mkDataConWorkerOcc, mkNewTyCoOcc,
mkInstTyCoOcc, mkEqPredCoOcc, mkClassOpAuxOcc,
mkCon2TagOcc, mkTag2ConOcc, mkMaxTagOcc
......@@ -634,19 +635,29 @@ mkCon2TagOcc = mk_simple_deriv varName "$con2tag_"
mkTag2ConOcc = mk_simple_deriv varName "$tag2con_"
mkMaxTagOcc = mk_simple_deriv varName "$maxtag_"
-- Generic derivable classes (old)
mkGenOcc1 = mk_simple_deriv varName "$gfrom"
mkGenOcc2 = mk_simple_deriv varName "$gto"
-- Generic deriving mechanism
-- Generic deriving mechanism (new)
mkGenD = mk_simple_deriv tcName "D1"
-- | Generate a module-unique name, to be used e.g. while generating new names
-- for Generics types. We use module package key to avoid name clashes when
-- package imports is used.
mkModPrefix :: Module -> String
mkModPrefix mod = pk ++ "_" ++ mn
where
pk = packageKeyString (modulePackageKey mod)
mn = moduleNameString (moduleName mod)
mkGenD :: Module -> OccName -> OccName
mkGenD mod = mk_simple_deriv tcName ("D1_" ++ mkModPrefix mod ++ "_")
mkGenC :: OccName -> Int -> OccName
mkGenC occ m = mk_deriv tcName ("C1_" ++ show m) (occNameString occ)
mkGenC :: Module -> OccName -> Int -> OccName
mkGenC mod occ m =
mk_deriv tcName ("C1_" ++ show m) $
mkModPrefix mod ++ "_" ++ occNameString occ
mkGenS :: OccName -> Int -> Int -> OccName
mkGenS occ m n = mk_deriv tcName ("S1_" ++ show m ++ "_" ++ show n)
(occNameString occ)
mkGenS :: Module -> OccName -> Int -> Int -> OccName
mkGenS mod occ m n =
mk_deriv tcName ("S1_" ++ show m ++ "_" ++ show n) $
mkModPrefix mod ++ "_" ++ occNameString occ
mkGenR = mk_simple_deriv tcName "Rep_"
mkGen1R = mk_simple_deriv tcName "Rep1_"
......
......@@ -447,11 +447,15 @@ type CommonAuxiliaries = NameEnv CommonAuxiliary
commonAuxiliaries :: [DerivSpec ()] -> TcM (CommonAuxiliaries, BagDerivStuff)
commonAuxiliaries = foldM snoc (emptyNameEnv, emptyBag) where
snoc acc@(cas, stuff) (DS {ds_name = nm, ds_cls = cls, ds_tc = rep_tycon})
snoc :: (CommonAuxiliaries, BagDerivStuff)
-> DerivSpec () -> TcM (CommonAuxiliaries, BagDerivStuff)
snoc acc@(cas, stuff) (DS {ds_cls = cls, ds_tc = rep_tycon})
| getUnique cls `elem` [genClassKey, gen1ClassKey] =
extendComAux $ genGenericMetaTyCons rep_tycon (nameModule nm)
extendComAux $ genGenericMetaTyCons rep_tycon
| otherwise = return acc
where extendComAux m -- don't run m if its already in the accumulator
where extendComAux :: TcM (MetaTyCons, BagDerivStuff)
-> TcM (CommonAuxiliaries, BagDerivStuff)
extendComAux m -- don't run m if its already in the accumulator
| elemNameEnv (tyConName rep_tycon) cas = return acc
| otherwise = do (ca, new_stuff) <- m
return ( extendNameEnv cas (tyConName rep_tycon) ca
......@@ -922,7 +926,7 @@ mk_data_eqn :: Maybe OverlapMode -> [TyVar] -> Class
-> TcM EarlyDerivSpec
mk_data_eqn overlap_mode tvs cls tycon tc_args rep_tc rep_tc_args mtheta
= do loc <- getSrcSpanM
dfun_name <- new_dfun_name cls tycon
dfun_name <- newDFunName' cls tycon
case mtheta of
Nothing -> do --Infer context
inferred_constraints <- inferConstraints cls inst_tys rep_tc rep_tc_args
......@@ -1375,13 +1379,6 @@ non_coercible_class cls
, genClassKey, gen1ClassKey, typeableClassKey
, traversableClassKey, liftClassKey ])
new_dfun_name :: Class -> TyCon -> TcM Name
new_dfun_name clas tycon -- Just a simple wrapper
= do { loc <- getSrcSpanM -- The location of the instance decl, not of the tycon
; newDFunName clas [mkTyConApp tycon []] loc }
-- The type passed to newDFunName is only used to generate
-- a suitable string; hence the empty type arg list
badCon :: DataCon -> SDoc -> SDoc
badCon con msg = ptext (sLit "Constructor") <+> quotes (ppr con) <+> msg
......@@ -1465,7 +1462,7 @@ mkNewTypeEqn dflags overlap_mode tvs
might_derive_via_coercible && ((newtype_deriving && not deriveAnyClass)
|| std_class_via_coercible cls)
= do traceTc "newtype deriving:" (ppr tycon <+> ppr rep_tys <+> ppr all_preds)
dfun_name <- new_dfun_name cls tycon
dfun_name <- newDFunName' cls tycon
loc <- getSrcSpanM
case mtheta of
Just theta -> return $ GivenTheta $ DS
......@@ -2009,9 +2006,9 @@ genDerivStuff :: SrcSpan -> Class -> Name -> TyCon
-> TcM (LHsBinds RdrName, BagDerivStuff)
genDerivStuff loc clas dfun_name tycon comaux_maybe
| let ck = classKey clas
, ck `elem` [genClassKey, gen1ClassKey] -- Special case because monadic
= let gk = if ck == genClassKey then Gen0 else Gen1
-- TODO NSF: correctly identify when we're building Both instead of One
, -- Special case because monadic
Just gk <- lookup ck [(genClassKey, Gen0), (gen1ClassKey, Gen1)]
= let -- TODO NSF: correctly identify when we're building Both instead of One
Just metaTyCons = comaux_maybe -- well-guarded by commonAuxiliaries and genInst
in do
(binds, faminst) <- gen_Generic_binds gk tycon metaTyCons (nameModule dfun_name)
......
......@@ -54,7 +54,8 @@ module TcEnv(
topIdLvl, isBrackStage,
-- New Ids
newLocalName, newDFunName, newFamInstTyConName, newFamInstAxiomName,
newLocalName, newDFunName, newDFunName', newFamInstTyConName,
newFamInstAxiomName,
mkStableIdFromString, mkStableIdFromName,
mkWrapperName
) where
......@@ -740,11 +741,9 @@ simpleInstInfoTyCon :: InstInfo a -> TyCon
-- i.e. one of the form instance (...) => C (T a b c) where ...
simpleInstInfoTyCon inst = tcTyConAppTyCon (simpleInstInfoTy inst)
{-
Make a name for the dict fun for an instance decl. It's an *external*
name, like otber top-level names, and hence must be made with newGlobalBinder.
-}
-- | Make a name for the dict fun for an instance decl. It's an *external*
-- name, like other top-level names, and hence must be made with
-- newGlobalBinder.
newDFunName :: Class -> [Type] -> SrcSpan -> TcM Name
newDFunName clas tys loc
= do { is_boot <- tcIsHsBootOrSig
......@@ -754,6 +753,15 @@ newDFunName clas tys loc
; dfun_occ <- chooseUniqueOccTc (mkDFunOcc info_string is_boot)
; newGlobalBinder mod dfun_occ loc }
-- | Special case of 'newDFunName' to generate dict fun name for a single TyCon.
newDFunName' :: Class -> TyCon -> TcM Name
newDFunName' clas tycon -- Just a simple wrapper
= do { loc <- getSrcSpanM -- The location of the instance decl,
-- not of the tycon
; newDFunName clas [mkTyConApp tycon []] loc }
-- The type passed to newDFunName is only used to generate
-- a suitable string; hence the empty type arg list
{-
Make a name for the representation tycon of a family instance. It's an
*external* name, like other top-level names, and hence must be made with
......
......@@ -6,7 +6,7 @@ The deriving code for the Generic class
(equivalent to the code in TcGenDeriv, for other classes)
-}
{-# LANGUAGE CPP, ScopedTypeVariables #-}
{-# LANGUAGE CPP, ScopedTypeVariables, TupleSections #-}
{-# LANGUAGE FlexibleContexts #-}
module TcGenGenerics (canDoGenerics, canDoGenerics1,
......@@ -25,7 +25,7 @@ import TyCon
import FamInstEnv ( FamInst, FamFlavor(..), mkSingleCoAxiom )
import FamInst
import Module ( Module, moduleName, moduleNameString
, modulePackageKey, packageKeyString )
, modulePackageKey, packageKeyString, getModule )
import IfaceEnv ( newGlobalBinder )
import Name hiding ( varName )
import RdrName
......@@ -71,18 +71,18 @@ gen_Generic_binds gk tc metaTyCons mod = do
repTyInsts <- tc_mkRepFamInsts gk tc metaTyCons mod
return (mkBindsRep gk tc, repTyInsts)
genGenericMetaTyCons :: TyCon -> Module -> TcM (MetaTyCons, BagDerivStuff)
genGenericMetaTyCons tc mod =
do loc <- getSrcSpanM
let
genGenericMetaTyCons :: TyCon -> TcM (MetaTyCons, BagDerivStuff)
genGenericMetaTyCons tc =
do let
tc_name = tyConName tc
mod = nameModule tc_name
tc_cons = tyConDataCons tc
tc_arits = map dataConSourceArity tc_cons
tc_occ = nameOccName tc_name
d_occ = mkGenD tc_occ
c_occ m = mkGenC tc_occ m
s_occ m n = mkGenS tc_occ m n
d_occ = mkGenD mod tc_occ
c_occ m = mkGenC mod tc_occ m
s_occ m n = mkGenS mod tc_occ m n
mkTyCon name = ASSERT( isExternalName name )
buildAlgTyCon name [] [] Nothing [] distinctAbstractTyConRhs
......@@ -91,11 +91,14 @@ genGenericMetaTyCons tc mod =
False -- Not GADT syntax
NoParentTyCon
d_name <- newGlobalBinder mod d_occ loc
loc <- getSrcSpanM
-- we generate new names in current module
currentMod <- getModule
d_name <- newGlobalBinder currentMod d_occ loc
c_names <- forM (zip [0..] tc_cons) $ \(m,_) ->
newGlobalBinder mod (c_occ m) loc
newGlobalBinder currentMod (c_occ m) loc
s_names <- forM (zip [0..] tc_arits) $ \(m,a) -> forM [0..a-1] $ \n ->
newGlobalBinder mod (s_occ m n) loc
newGlobalBinder currentMod (s_occ m n) loc
let metaDTyCon = mkTyCon d_name
metaCTyCons = map mkTyCon c_names
......@@ -103,23 +106,22 @@ genGenericMetaTyCons tc mod =
metaDts = MetaTyCons metaDTyCon metaCTyCons metaSTyCons
-- pprTrace "rep0" (ppr rep0_tycon) $
(,) metaDts `fmap` metaTyConsToDerivStuff tc metaDts
-- both the tycon declarations and related instances
metaTyConsToDerivStuff :: TyCon -> MetaTyCons -> TcM BagDerivStuff
metaTyConsToDerivStuff tc metaDts =
do loc <- getSrcSpanM
dflags <- getDynFlags
do dflags <- getDynFlags
dClas <- tcLookupClass datatypeClassName
let new_dfun_name clas tycon = newDFunName clas [mkTyConApp tycon []] loc
d_dfun_name <- new_dfun_name dClas tc
d_dfun_name <- newDFunName' dClas tc
cClas <- tcLookupClass constructorClassName
c_dfun_names <- sequence [ new_dfun_name cClas tc | _ <- metaC metaDts ]
c_dfun_names <- sequence [ (conTy,) <$> newDFunName' cClas tc
| conTy <- metaC metaDts ]
sClas <- tcLookupClass selectorClassName
s_dfun_names <- sequence (map sequence [ [ new_dfun_name sClas tc
| _ <- x ]
| x <- metaS metaDts ])
s_dfun_names <-
sequence (map sequence [ [ (selector,) <$> newDFunName' sClas tc
| selector <- selectors ]
| selectors <- metaS metaDts ])
fix_env <- getFixityEnv
let
......@@ -143,9 +145,7 @@ metaTyConsToDerivStuff tc metaDts =
d_mkInst = DerivInst (InstInfo { iSpec = d_inst, iBinds = d_binds })
-- Constructor
c_metaTycons = metaC metaDts
c_insts = [ mk_inst cClas c ds
| (c, ds) <- myZip1 c_metaTycons c_dfun_names ]
c_insts = [ mk_inst cClas c ds | (c, ds) <- c_dfun_names ]
c_binds = [ InstBindings { ib_binds = c
, ib_tyvars = []
, ib_pragmas = []
......@@ -156,9 +156,7 @@ metaTyConsToDerivStuff tc metaDts =
| (is,bs) <- myZip1 c_insts c_binds ]
-- Selector
s_metaTycons = metaS metaDts
s_insts = map (map (\(s,ds) -> mk_inst sClas s ds))
(myZip2 s_metaTycons s_dfun_names)
s_insts = map (map (\(s,ds) -> mk_inst sClas s ds)) s_dfun_names
s_binds = [ [ InstBindings { ib_binds = s
, ib_tyvars = []
, ib_pragmas = []
......
{-# LANGUAGE StandaloneDeriving, DeriveGeneric #-}
module T10487 where
import GHC.Generics
import qualified T10487_M as M
data Name = Name
deriving instance Generic Name
deriving instance Generic M.Name
module T10487_M where
data Name = Name
......@@ -55,4 +55,4 @@ test('T9359', normal, compile, [''])
test('T4896', normal, compile, [''])
test('T7947', extra_clean(['T7947a.o', 'T7947a.hi', 'T7947b.o', 'T7947b.hi']), multimod_compile, ['T7947', '-v0'])
test('T10561', normal, compile_fail, [''])
test('T10487', extra_clean(['T10487_M.o', 'T10487_M.hi']), multimod_compile, ['T10487', '-v0'])
......@@ -88,84 +88,95 @@ Derived instances:
((GHC.Base..)
(GHC.Base.fmap GHC.Generics.unRec1) GHC.Generics.unComp1 g2)
instance GHC.Generics.Datatype GenDerivOutput.D1List where
instance GHC.Generics.Datatype
GenDerivOutput.D1_main_GenDerivOutput_List where
GHC.Generics.datatypeName _ = "List"
GHC.Generics.moduleName _ = "GenDerivOutput"
GHC.Generics.packageName _ = "main"
instance GHC.Generics.Constructor GenDerivOutput.C1_0List where
instance GHC.Generics.Constructor
GenDerivOutput.C1_0main_GenDerivOutput_List where
GHC.Generics.conName _ = "Nil"
instance GHC.Generics.Constructor GenDerivOutput.C1_1List where
instance GHC.Generics.Constructor
GenDerivOutput.C1_1main_GenDerivOutput_List where
GHC.Generics.conName _ = "Cons"
GHC.Generics.conIsRecord _ = GHC.Types.True
instance GHC.Generics.Selector GenDerivOutput.S1_1_0List where
instance GHC.Generics.Selector
GenDerivOutput.S1_1_0main_GenDerivOutput_List where
GHC.Generics.selName _ = "element"
instance GHC.Generics.Selector GenDerivOutput.S1_1_1List where
instance GHC.Generics.Selector
GenDerivOutput.S1_1_1main_GenDerivOutput_List where
GHC.Generics.selName _ = "rest"
instance GHC.Generics.Datatype GenDerivOutput.D1Rose where
instance GHC.Generics.Datatype
GenDerivOutput.D1_main_GenDerivOutput_Rose where
GHC.Generics.datatypeName _ = "Rose"
GHC.Generics.moduleName _ = "GenDerivOutput"
GHC.Generics.packageName _ = "main"
instance GHC.Generics.Constructor GenDerivOutput.C1_0Rose where
instance GHC.Generics.Constructor
GenDerivOutput.C1_0main_GenDerivOutput_Rose where
GHC.Generics.conName _ = "Empty"
instance GHC.Generics.Constructor GenDerivOutput.C1_1Rose where
instance GHC.Generics.Constructor
GenDerivOutput.C1_1main_GenDerivOutput_Rose where
GHC.Generics.conName _ = "Rose"
Generic representation:
Generated datatypes for meta-information:
GenDerivOutput.D1List
GenDerivOutput.C1_0List
GenDerivOutput.C1_1List
GenDerivOutput.S1_1_0List
GenDerivOutput.S1_1_1List
GenDerivOutput.D1Rose
GenDerivOutput.C1_0Rose
GenDerivOutput.C1_1Rose
GenDerivOutput.S1_1_0Rose
GenDerivOutput.S1_1_1Rose
GenDerivOutput.D1_main_GenDerivOutput_List
GenDerivOutput.C1_0main_GenDerivOutput_List
GenDerivOutput.C1_1main_GenDerivOutput_List
GenDerivOutput.S1_1_0main_GenDerivOutput_List
GenDerivOutput.S1_1_1main_GenDerivOutput_List
GenDerivOutput.D1_main_GenDerivOutput_Rose
GenDerivOutput.C1_0main_GenDerivOutput_Rose
GenDerivOutput.C1_1main_GenDerivOutput_Rose
GenDerivOutput.S1_1_0main_GenDerivOutput_Rose
GenDerivOutput.S1_1_1main_GenDerivOutput_Rose
Representation types:
type GHC.Generics.Rep (GenDerivOutput.List a) = GHC.Generics.D1
GenDerivOutput.D1List
GenDerivOutput.D1_main_GenDerivOutput_List
(GHC.Generics.C1
GenDerivOutput.C1_0List GHC.Generics.U1
GenDerivOutput.C1_0main_GenDerivOutput_List
GHC.Generics.U1
GHC.Generics.:+: GHC.Generics.C1
GenDerivOutput.C1_1List
GenDerivOutput.C1_1main_GenDerivOutput_List
(GHC.Generics.S1
GenDerivOutput.S1_1_0List
GenDerivOutput.S1_1_0main_GenDerivOutput_List
(GHC.Generics.Rec0 a)
GHC.Generics.:*: GHC.Generics.S1
GenDerivOutput.S1_1_1List
GenDerivOutput.S1_1_1main_GenDerivOutput_List
(GHC.Generics.Rec0
(GenDerivOutput.List
a))))
type GHC.Generics.Rep1 GenDerivOutput.List = GHC.Generics.D1
GenDerivOutput.D1List
GenDerivOutput.D1_main_GenDerivOutput_List
(GHC.Generics.C1
GenDerivOutput.C1_0List GHC.Generics.U1
GenDerivOutput.C1_0main_GenDerivOutput_List
GHC.Generics.U1
GHC.Generics.:+: GHC.Generics.C1
GenDerivOutput.C1_1List
GenDerivOutput.C1_1main_GenDerivOutput_List
(GHC.Generics.S1
GenDerivOutput.S1_1_0List
GenDerivOutput.S1_1_0main_GenDerivOutput_List
GHC.Generics.Par1
GHC.Generics.:*: GHC.Generics.S1
GenDerivOutput.S1_1_1List
GenDerivOutput.S1_1_1main_GenDerivOutput_List
(GHC.Generics.Rec1
GenDerivOutput.List)))
type GHC.Generics.Rep (GenDerivOutput.Rose a) = GHC.Generics.D1
GenDerivOutput.D1Rose
GenDerivOutput.D1_main_GenDerivOutput_Rose
(GHC.Generics.C1
GenDerivOutput.C1_0Rose GHC.Generics.U1
GenDerivOutput.C1_0main_GenDerivOutput_Rose
GHC.Generics.U1
GHC.Generics.:+: GHC.Generics.C1
GenDerivOutput.C1_1Rose
GenDerivOutput.C1_1main_GenDerivOutput_Rose
(GHC.Generics.S1
GHC.Generics.NoSelector
(GHC.Generics.Rec0 a)
......@@ -176,11 +187,12 @@ Generic representation:
(GenDerivOutput.Rose
a)))))
type GHC.Generics.Rep1 GenDerivOutput.Rose = GHC.Generics.D1
GenDerivOutput.D1Rose
GenDerivOutput.D1_main_GenDerivOutput_Rose
(GHC.Generics.C1
GenDerivOutput.C1_0Rose GHC.Generics.U1
GenDerivOutput.C1_0main_GenDerivOutput_Rose
GHC.Generics.U1
GHC.Generics.:+: GHC.Generics.C1
GenDerivOutput.C1_1Rose
GenDerivOutput.C1_1main_GenDerivOutput_Rose
(GHC.Generics.S1
GHC.Generics.NoSelector
GHC.Generics.Par1
......
......@@ -21,46 +21,52 @@ Derived instances:
= GenDerivOutput1_0.Cons
(GHC.Generics.unPar1 g1) (GHC.Generics.unRec1 g2)
instance GHC.Generics.Datatype GenDerivOutput1_0.D1List where
instance GHC.Generics.Datatype
GenDerivOutput1_0.D1_main_GenDerivOutput1_0_List where
GHC.Generics.datatypeName _ = "List"
GHC.Generics.moduleName _ = "GenDerivOutput1_0"
GHC.Generics.packageName _ = "main"
instance GHC.Generics.Constructor GenDerivOutput1_0.C1_0List where
instance GHC.Generics.Constructor
GenDerivOutput1_0.C1_0main_GenDerivOutput1_0_List where
GHC.Generics.conName _ = "Nil"
instance GHC.Generics.Constructor GenDerivOutput1_0.C1_1List where
instance GHC.Generics.Constructor
GenDerivOutput1_0.C1_1main_GenDerivOutput1_0_List where
GHC.Generics.conName _ = "Cons"
GHC.Generics.conIsRecord _ = GHC.Types.True
instance GHC.Generics.Selector GenDerivOutput1_0.S1_1_0List where
instance GHC.Generics.Selector
GenDerivOutput1_0.S1_1_0main_GenDerivOutput1_0_List where
GHC.Generics.selName _ = "element"
instance GHC.Generics.Selector GenDerivOutput1_0.S1_1_1List where
instance GHC.Generics.Selector
GenDerivOutput1_0.S1_1_1main_GenDerivOutput1_0_List where
GHC.Generics.selName _ = "rest"
Generic representation:
Generated datatypes for meta-information:
GenDerivOutput1_0.D1List
GenDerivOutput1_0.C1_0List
GenDerivOutput1_0.C1_1List
GenDerivOutput1_0.S1_1_0List
GenDerivOutput1_0.S1_1_1List
GenDerivOutput1_0.D1_main_GenDerivOutput1_0_List
GenDerivOutput1_0.C1_0main_GenDerivOutput1_0_List
GenDerivOutput1_0.C1_1main_GenDerivOutput1_0_List
GenDerivOutput1_0.S1_1_0main_GenDerivOutput1_0_List
GenDerivOutput1_0.S1_1_1main_GenDerivOutput1_0_List
Representation types:
type GHC.Generics.Rep1 GenDerivOutput1_0.List = GHC.Generics.D1
GenDerivOutput1_0.D1List
GenDerivOutput1_0.D1_main_GenDerivOutput1_0_List
(GHC.Generics.C1
GenDerivOutput1_0.C1_0List GHC.Generics.U1
GenDerivOutput1_0.C1_0main_GenDerivOutput1_0_List
GHC.Generics.U1
GHC.Generics.:+: GHC.Generics.C1
GenDerivOutput1_0.C1_1List
GenDerivOutput1_0.C1_1main_GenDerivOutput1_0_List
(GHC.Generics.S1
GenDerivOutput1_0.S1_1_0List
GenDerivOutput1_0.S1_1_0main_GenDerivOutput1_0_List
GHC.Generics.Par1
GHC.Generics.:*: GHC.Generics.S1
GenDerivOutput1_0.S1_1_1List
GenDerivOutput1_0.S1_1_1main_GenDerivOutput1_0_List
(GHC.Generics.Rec1
GenDerivOutput1_0.List)))
......
......@@ -153,202 +153,234 @@ Derived instances:
(GHC.Generics.M1 g2)))))
= CanDoRep1_1.D1c (GHC.Generics.unPar1 g1) (GHC.Generics.unRec1 g2)
instance GHC.Generics.Datatype CanDoRep1_1.D1Da where
instance GHC.Generics.Datatype
CanDoRep1_1.D1_main_CanDoRep1_1_Da where
GHC.Generics.datatypeName _ = "Da"
GHC.Generics.moduleName _ = "CanDoRep1_1"
GHC.Generics.packageName _ = "main"
instance GHC.Generics.Constructor CanDoRep1_1.C1_0Da where
instance GHC.Generics.Constructor
CanDoRep1_1.C1_0main_CanDoRep1_1_Da where
GHC.Generics.conName _ = "D0"
instance GHC.Generics.Constructor CanDoRep1_1.C1_1Da where
instance GHC.Generics.Constructor
CanDoRep1_1.C1_1main_CanDoRep1_1_Da where
GHC.Generics.conName _ = "D1"
GHC.Generics.conIsRecord _ = GHC.Types.True
instance GHC.Generics.Selector CanDoRep1_1.S1_1_0Da where
instance GHC.Generics.Selector
CanDoRep1_1.S1_1_0main_CanDoRep1_1_Da where
GHC.Generics.selName _ = "d11a"
instance GHC.Generics.Selector CanDoRep1_1.S1_1_1Da where
instance GHC.Generics.Selector
CanDoRep1_1.S1_1_1main_CanDoRep1_1_Da where
GHC.Generics.selName _ = "d12a"
instance GHC.Generics.Datatype CanDoRep1_1.D1Db where
instance GHC.Generics.Datatype
CanDoRep1_1.D1_main_CanDoRep1_1_Db where
GHC.Generics.datatypeName _ = "Db"
GHC.Generics.moduleName _ = "CanDoRep1_1"
GHC.Generics.packageName _ = "main"
instance GHC.Generics.Constructor CanDoRep1_1.C1_0Db where
instance GHC.Generics.Constructor
CanDoRep1_1.C1_0main_CanDoRep1_1_Db where
GHC.Generics.conName _ = "D0b"
instance GHC.Generics.Constructor CanDoRep1_1.C1_1Db where
instance GHC.Generics.Constructor
CanDoRep1_1.C1_1main_CanDoRep1_1_Db where
GHC.Generics.conName _ = "D1b"
GHC.Generics.conIsRecord _ = GHC.Types.True
instance GHC.Generics.Selector CanDoRep1_1.S1_1_0Db where
instance GHC.Generics.Selector
CanDoRep1_1.S1_1_0main_CanDoRep1_1_Db where
GHC.Generics.selName _ = "d11b"
instance GHC.Generics.Selector CanDoRep1_1.S1_1_1Db where
instance GHC.Generics.Selector
CanDoRep1_1.S1_1_1main_CanDoRep1_1_Db where
GHC.Generics.selName _ = "d12b"
instance GHC.Generics.Datatype CanDoRep1_1.D1Dc where
instance GHC.Generics.Datatype
CanDoRep1_1.D1_main_CanDoRep1_1_Dc where
GHC.Generics.datatypeName _ = "Dc"
GHC.Generics.moduleName _ = "CanDoRep1_1"
GHC.Generics.packageName _ = "main"
instance GHC.Generics.Constructor CanDoRep1_1.C1_0Dc where
instance GHC.Generics.Constructor
CanDoRep1_1.C1_0main_CanDoRep1_1_Dc where
GHC.Generics.conName _ = "D0c"
instance GHC.Generics.Constructor CanDoRep1_1.C1_1Dc where
instance GHC.Generics.Constructor
CanDoRep1_1.C1_1main_CanDoRep1_1_Dc where
GHC.Generics.conName _ = "D1c"
GHC.Generics.conIsRecord _ = GHC.Types.True
instance GHC.Generics.Selector CanDoRep1_1.S1_1_0Dc where
instance GHC.Generics.Selector
CanDoRep1_1.S1_1_0main_CanDoRep1_1_Dc where
GHC.Generics.selName _ = "d11c"
instance GHC.Generics.Selector CanDoRep1_1.S1_1_1Dc where
instance GHC.Generics.Selector
CanDoRep1_1.S1_1_1main_CanDoRep1_1_Dc where
GHC.Generics.selName _ = "d12c"
instance GHC.Generics.Datatype CanDoRep1_1.D1Dd where
instance GHC.Generics.Datatype
CanDoRep1_1.D1_main_CanDoRep1_1_Dd where
GHC.Generics.datatypeName _ = "Dd"
GHC.Generics.moduleName _ = "CanDoRep1_1"
GHC.Generics.packageName _ = "main"
instance GHC.Generics.Constructor CanDoRep1_1.C1_0Dd where
instance GHC.Generics.Constructor
CanDoRep1_1.C1_0main_CanDoRep1_1_Dd where
GHC.Generics.conName _ = "D0d"
instance GHC.Generics.Constructor CanDoRep1_1.C1_1Dd where
instance GHC.Generics.Constructor
CanDoRep1_1.C1_1main_CanDoRep1_1_Dd where
GHC.Generics.conName _ = "D1d"
GHC.Generics.conIsRecord _ = GHC.Types.True
instance GHC.Generics.Selector CanDoRep1_1.S1_1_0Dd where
instance GHC.Generics.Selector
CanDoRep1_1.S1_1_0main_CanDoRep1_1_Dd where
GHC.Generics.selName _ = "d11d"
instance GHC.Generics.Selector CanDoRep1_1.S1_1_1Dd where
instance GHC.Generics.Selector
CanDoRep1_1.S1_1_1main_CanDoRep1_1_Dd where
GHC.Generics.selName _ = "d12d"
Generic representation: