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 ( ...@@ -60,7 +60,7 @@ module OccName (
mkDerivedTyConOcc, mkNewTyCoOcc, mkClassOpAuxOcc, mkDerivedTyConOcc, mkNewTyCoOcc, mkClassOpAuxOcc,
mkCon2TagOcc, mkTag2ConOcc, mkMaxTagOcc, mkCon2TagOcc, mkTag2ConOcc, mkMaxTagOcc,
mkClassDataConOcc, mkDictOcc, mkIPOcc, mkClassDataConOcc, mkDictOcc, mkIPOcc,
mkSpecOcc, mkForeignExportOcc, mkRepEqOcc, mkGenOcc1, mkGenOcc2, mkSpecOcc, mkForeignExportOcc, mkRepEqOcc,
mkGenD, mkGenR, mkGen1R, mkGenRCo, mkGenC, mkGenS, mkGenD, mkGenR, mkGen1R, mkGenRCo, mkGenC, mkGenS,
mkDataTOcc, mkDataCOcc, mkDataConWorkerOcc, mkDataTOcc, mkDataCOcc, mkDataConWorkerOcc,
mkSuperDictSelOcc, mkSuperDictAuxOcc, mkSuperDictSelOcc, mkSuperDictAuxOcc,
...@@ -109,6 +109,7 @@ import FastString ...@@ -109,6 +109,7 @@ import FastString
import Outputable import Outputable
import Lexeme import Lexeme
import Binary import Binary
import Module
import Data.Char import Data.Char
import Data.Data import Data.Data
...@@ -602,8 +603,8 @@ mkDataConWrapperOcc, mkWorkerOcc, ...@@ -602,8 +603,8 @@ mkDataConWrapperOcc, mkWorkerOcc,
mkMatcherOcc, mkBuilderOcc, mkMatcherOcc, mkBuilderOcc,
mkDefaultMethodOcc, mkDefaultMethodOcc,
mkGenDefMethodOcc, mkDerivedTyConOcc, mkClassDataConOcc, mkDictOcc, mkGenDefMethodOcc, mkDerivedTyConOcc, mkClassDataConOcc, mkDictOcc,
mkIPOcc, mkSpecOcc, mkForeignExportOcc, mkRepEqOcc, mkGenOcc1, mkGenOcc2, mkIPOcc, mkSpecOcc, mkForeignExportOcc, mkRepEqOcc,
mkGenD, mkGenR, mkGen1R, mkGenRCo, mkGenR, mkGen1R, mkGenRCo,
mkDataTOcc, mkDataCOcc, mkDataConWorkerOcc, mkNewTyCoOcc, mkDataTOcc, mkDataCOcc, mkDataConWorkerOcc, mkNewTyCoOcc,
mkInstTyCoOcc, mkEqPredCoOcc, mkClassOpAuxOcc, mkInstTyCoOcc, mkEqPredCoOcc, mkClassOpAuxOcc,
mkCon2TagOcc, mkTag2ConOcc, mkMaxTagOcc mkCon2TagOcc, mkTag2ConOcc, mkMaxTagOcc
...@@ -634,19 +635,29 @@ mkCon2TagOcc = mk_simple_deriv varName "$con2tag_" ...@@ -634,19 +635,29 @@ mkCon2TagOcc = mk_simple_deriv varName "$con2tag_"
mkTag2ConOcc = mk_simple_deriv varName "$tag2con_" mkTag2ConOcc = mk_simple_deriv varName "$tag2con_"
mkMaxTagOcc = mk_simple_deriv varName "$maxtag_" mkMaxTagOcc = mk_simple_deriv varName "$maxtag_"
-- Generic derivable classes (old) -- Generic deriving mechanism
mkGenOcc1 = mk_simple_deriv varName "$gfrom"
mkGenOcc2 = mk_simple_deriv varName "$gto"
-- Generic deriving mechanism (new) -- | Generate a module-unique name, to be used e.g. while generating new names
mkGenD = mk_simple_deriv tcName "D1" -- 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 :: Module -> OccName -> Int -> OccName
mkGenC occ m = mk_deriv tcName ("C1_" ++ show m) (occNameString occ) mkGenC mod occ m =
mk_deriv tcName ("C1_" ++ show m) $
mkModPrefix mod ++ "_" ++ occNameString occ
mkGenS :: OccName -> Int -> Int -> OccName mkGenS :: Module -> OccName -> Int -> Int -> OccName
mkGenS occ m n = mk_deriv tcName ("S1_" ++ show m ++ "_" ++ show n) mkGenS mod occ m n =
(occNameString occ) mk_deriv tcName ("S1_" ++ show m ++ "_" ++ show n) $
mkModPrefix mod ++ "_" ++ occNameString occ
mkGenR = mk_simple_deriv tcName "Rep_" mkGenR = mk_simple_deriv tcName "Rep_"
mkGen1R = mk_simple_deriv tcName "Rep1_" mkGen1R = mk_simple_deriv tcName "Rep1_"
......
...@@ -447,11 +447,15 @@ type CommonAuxiliaries = NameEnv CommonAuxiliary ...@@ -447,11 +447,15 @@ type CommonAuxiliaries = NameEnv CommonAuxiliary
commonAuxiliaries :: [DerivSpec ()] -> TcM (CommonAuxiliaries, BagDerivStuff) commonAuxiliaries :: [DerivSpec ()] -> TcM (CommonAuxiliaries, BagDerivStuff)
commonAuxiliaries = foldM snoc (emptyNameEnv, emptyBag) where 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] = | getUnique cls `elem` [genClassKey, gen1ClassKey] =
extendComAux $ genGenericMetaTyCons rep_tycon (nameModule nm) extendComAux $ genGenericMetaTyCons rep_tycon
| otherwise = return acc | 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 | elemNameEnv (tyConName rep_tycon) cas = return acc
| otherwise = do (ca, new_stuff) <- m | otherwise = do (ca, new_stuff) <- m
return ( extendNameEnv cas (tyConName rep_tycon) ca return ( extendNameEnv cas (tyConName rep_tycon) ca
...@@ -922,7 +926,7 @@ mk_data_eqn :: Maybe OverlapMode -> [TyVar] -> Class ...@@ -922,7 +926,7 @@ mk_data_eqn :: Maybe OverlapMode -> [TyVar] -> Class
-> TcM EarlyDerivSpec -> TcM EarlyDerivSpec
mk_data_eqn overlap_mode tvs cls tycon tc_args rep_tc rep_tc_args mtheta mk_data_eqn overlap_mode tvs cls tycon tc_args rep_tc rep_tc_args mtheta
= do loc <- getSrcSpanM = do loc <- getSrcSpanM
dfun_name <- new_dfun_name cls tycon dfun_name <- newDFunName' cls tycon
case mtheta of case mtheta of
Nothing -> do --Infer context Nothing -> do --Infer context
inferred_constraints <- inferConstraints cls inst_tys rep_tc rep_tc_args inferred_constraints <- inferConstraints cls inst_tys rep_tc rep_tc_args
...@@ -1375,13 +1379,6 @@ non_coercible_class cls ...@@ -1375,13 +1379,6 @@ non_coercible_class cls
, genClassKey, gen1ClassKey, typeableClassKey , genClassKey, gen1ClassKey, typeableClassKey
, traversableClassKey, liftClassKey ]) , 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 :: DataCon -> SDoc -> SDoc
badCon con msg = ptext (sLit "Constructor") <+> quotes (ppr con) <+> msg badCon con msg = ptext (sLit "Constructor") <+> quotes (ppr con) <+> msg
...@@ -1465,7 +1462,7 @@ mkNewTypeEqn dflags overlap_mode tvs ...@@ -1465,7 +1462,7 @@ mkNewTypeEqn dflags overlap_mode tvs
might_derive_via_coercible && ((newtype_deriving && not deriveAnyClass) might_derive_via_coercible && ((newtype_deriving && not deriveAnyClass)
|| std_class_via_coercible cls) || std_class_via_coercible cls)
= do traceTc "newtype deriving:" (ppr tycon <+> ppr rep_tys <+> ppr all_preds) = 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 loc <- getSrcSpanM
case mtheta of case mtheta of
Just theta -> return $ GivenTheta $ DS Just theta -> return $ GivenTheta $ DS
...@@ -2009,9 +2006,9 @@ genDerivStuff :: SrcSpan -> Class -> Name -> TyCon ...@@ -2009,9 +2006,9 @@ genDerivStuff :: SrcSpan -> Class -> Name -> TyCon
-> TcM (LHsBinds RdrName, BagDerivStuff) -> TcM (LHsBinds RdrName, BagDerivStuff)
genDerivStuff loc clas dfun_name tycon comaux_maybe genDerivStuff loc clas dfun_name tycon comaux_maybe
| let ck = classKey clas | let ck = classKey clas
, ck `elem` [genClassKey, gen1ClassKey] -- Special case because monadic , -- Special case because monadic
= let gk = if ck == genClassKey then Gen0 else Gen1 Just gk <- lookup ck [(genClassKey, Gen0), (gen1ClassKey, Gen1)]
-- TODO NSF: correctly identify when we're building Both instead of One = let -- TODO NSF: correctly identify when we're building Both instead of One
Just metaTyCons = comaux_maybe -- well-guarded by commonAuxiliaries and genInst Just metaTyCons = comaux_maybe -- well-guarded by commonAuxiliaries and genInst
in do in do
(binds, faminst) <- gen_Generic_binds gk tycon metaTyCons (nameModule dfun_name) (binds, faminst) <- gen_Generic_binds gk tycon metaTyCons (nameModule dfun_name)
......
...@@ -54,7 +54,8 @@ module TcEnv( ...@@ -54,7 +54,8 @@ module TcEnv(
topIdLvl, isBrackStage, topIdLvl, isBrackStage,
-- New Ids -- New Ids
newLocalName, newDFunName, newFamInstTyConName, newFamInstAxiomName, newLocalName, newDFunName, newDFunName', newFamInstTyConName,
newFamInstAxiomName,
mkStableIdFromString, mkStableIdFromName, mkStableIdFromString, mkStableIdFromName,
mkWrapperName mkWrapperName
) where ) where
...@@ -740,11 +741,9 @@ simpleInstInfoTyCon :: InstInfo a -> TyCon ...@@ -740,11 +741,9 @@ simpleInstInfoTyCon :: InstInfo a -> TyCon
-- i.e. one of the form instance (...) => C (T a b c) where ... -- i.e. one of the form instance (...) => C (T a b c) where ...
simpleInstInfoTyCon inst = tcTyConAppTyCon (simpleInstInfoTy inst) simpleInstInfoTyCon inst = tcTyConAppTyCon (simpleInstInfoTy inst)
{- -- | Make a name for the dict fun for an instance decl. It's an *external*
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
name, like otber top-level names, and hence must be made with newGlobalBinder. -- newGlobalBinder.
-}
newDFunName :: Class -> [Type] -> SrcSpan -> TcM Name newDFunName :: Class -> [Type] -> SrcSpan -> TcM Name
newDFunName clas tys loc newDFunName clas tys loc
= do { is_boot <- tcIsHsBootOrSig = do { is_boot <- tcIsHsBootOrSig
...@@ -754,6 +753,15 @@ newDFunName clas tys loc ...@@ -754,6 +753,15 @@ newDFunName clas tys loc
; dfun_occ <- chooseUniqueOccTc (mkDFunOcc info_string is_boot) ; dfun_occ <- chooseUniqueOccTc (mkDFunOcc info_string is_boot)
; newGlobalBinder mod dfun_occ loc } ; 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 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 *external* name, like other top-level names, and hence must be made with
......
...@@ -6,7 +6,7 @@ The deriving code for the Generic class ...@@ -6,7 +6,7 @@ The deriving code for the Generic class
(equivalent to the code in TcGenDeriv, for other classes) (equivalent to the code in TcGenDeriv, for other classes)
-} -}
{-# LANGUAGE CPP, ScopedTypeVariables #-} {-# LANGUAGE CPP, ScopedTypeVariables, TupleSections #-}
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleContexts #-}
module TcGenGenerics (canDoGenerics, canDoGenerics1, module TcGenGenerics (canDoGenerics, canDoGenerics1,
...@@ -25,7 +25,7 @@ import TyCon ...@@ -25,7 +25,7 @@ import TyCon
import FamInstEnv ( FamInst, FamFlavor(..), mkSingleCoAxiom ) import FamInstEnv ( FamInst, FamFlavor(..), mkSingleCoAxiom )
import FamInst import FamInst
import Module ( Module, moduleName, moduleNameString import Module ( Module, moduleName, moduleNameString
, modulePackageKey, packageKeyString ) , modulePackageKey, packageKeyString, getModule )
import IfaceEnv ( newGlobalBinder ) import IfaceEnv ( newGlobalBinder )
import Name hiding ( varName ) import Name hiding ( varName )
import RdrName import RdrName
...@@ -71,18 +71,18 @@ gen_Generic_binds gk tc metaTyCons mod = do ...@@ -71,18 +71,18 @@ gen_Generic_binds gk tc metaTyCons mod = do
repTyInsts <- tc_mkRepFamInsts gk tc metaTyCons mod repTyInsts <- tc_mkRepFamInsts gk tc metaTyCons mod
return (mkBindsRep gk tc, repTyInsts) return (mkBindsRep gk tc, repTyInsts)
genGenericMetaTyCons :: TyCon -> Module -> TcM (MetaTyCons, BagDerivStuff) genGenericMetaTyCons :: TyCon -> TcM (MetaTyCons, BagDerivStuff)
genGenericMetaTyCons tc mod = genGenericMetaTyCons tc =
do loc <- getSrcSpanM do let
let
tc_name = tyConName tc tc_name = tyConName tc
mod = nameModule tc_name
tc_cons = tyConDataCons tc tc_cons = tyConDataCons tc
tc_arits = map dataConSourceArity tc_cons tc_arits = map dataConSourceArity tc_cons
tc_occ = nameOccName tc_name tc_occ = nameOccName tc_name
d_occ = mkGenD tc_occ d_occ = mkGenD mod tc_occ
c_occ m = mkGenC tc_occ m c_occ m = mkGenC mod tc_occ m
s_occ m n = mkGenS tc_occ m n s_occ m n = mkGenS mod tc_occ m n
mkTyCon name = ASSERT( isExternalName name ) mkTyCon name = ASSERT( isExternalName name )
buildAlgTyCon name [] [] Nothing [] distinctAbstractTyConRhs buildAlgTyCon name [] [] Nothing [] distinctAbstractTyConRhs
...@@ -91,11 +91,14 @@ genGenericMetaTyCons tc mod = ...@@ -91,11 +91,14 @@ genGenericMetaTyCons tc mod =
False -- Not GADT syntax False -- Not GADT syntax
NoParentTyCon 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,_) -> 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 -> 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 let metaDTyCon = mkTyCon d_name
metaCTyCons = map mkTyCon c_names metaCTyCons = map mkTyCon c_names
...@@ -103,23 +106,22 @@ genGenericMetaTyCons tc mod = ...@@ -103,23 +106,22 @@ genGenericMetaTyCons tc mod =
metaDts = MetaTyCons metaDTyCon metaCTyCons metaSTyCons metaDts = MetaTyCons metaDTyCon metaCTyCons metaSTyCons
-- pprTrace "rep0" (ppr rep0_tycon) $
(,) metaDts `fmap` metaTyConsToDerivStuff tc metaDts (,) metaDts `fmap` metaTyConsToDerivStuff tc metaDts
-- both the tycon declarations and related instances -- both the tycon declarations and related instances
metaTyConsToDerivStuff :: TyCon -> MetaTyCons -> TcM BagDerivStuff metaTyConsToDerivStuff :: TyCon -> MetaTyCons -> TcM BagDerivStuff
metaTyConsToDerivStuff tc metaDts = metaTyConsToDerivStuff tc metaDts =
do loc <- getSrcSpanM do dflags <- getDynFlags
dflags <- getDynFlags
dClas <- tcLookupClass datatypeClassName dClas <- tcLookupClass datatypeClassName
let new_dfun_name clas tycon = newDFunName clas [mkTyConApp tycon []] loc d_dfun_name <- newDFunName' dClas tc
d_dfun_name <- new_dfun_name dClas tc
cClas <- tcLookupClass constructorClassName 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 sClas <- tcLookupClass selectorClassName
s_dfun_names <- sequence (map sequence [ [ new_dfun_name sClas tc s_dfun_names <-
| _ <- x ] sequence (map sequence [ [ (selector,) <$> newDFunName' sClas tc
| x <- metaS metaDts ]) | selector <- selectors ]
| selectors <- metaS metaDts ])
fix_env <- getFixityEnv fix_env <- getFixityEnv
let let
...@@ -143,9 +145,7 @@ metaTyConsToDerivStuff tc metaDts = ...@@ -143,9 +145,7 @@ metaTyConsToDerivStuff tc metaDts =
d_mkInst = DerivInst (InstInfo { iSpec = d_inst, iBinds = d_binds }) d_mkInst = DerivInst (InstInfo { iSpec = d_inst, iBinds = d_binds })
-- Constructor -- Constructor
c_metaTycons = metaC metaDts c_insts = [ mk_inst cClas c ds | (c, ds) <- c_dfun_names ]
c_insts = [ mk_inst cClas c ds
| (c, ds) <- myZip1 c_metaTycons c_dfun_names ]
c_binds = [ InstBindings { ib_binds = c c_binds = [ InstBindings { ib_binds = c
, ib_tyvars = [] , ib_tyvars = []
, ib_pragmas = [] , ib_pragmas = []
...@@ -156,9 +156,7 @@ metaTyConsToDerivStuff tc metaDts = ...@@ -156,9 +156,7 @@ metaTyConsToDerivStuff tc metaDts =
| (is,bs) <- myZip1 c_insts c_binds ] | (is,bs) <- myZip1 c_insts c_binds ]
-- Selector -- Selector
s_metaTycons = metaS metaDts s_insts = map (map (\(s,ds) -> mk_inst sClas s ds)) s_dfun_names
s_insts = map (map (\(s,ds) -> mk_inst sClas s ds))
(myZip2 s_metaTycons s_dfun_names)
s_binds = [ [ InstBindings { ib_binds = s s_binds = [ [ InstBindings { ib_binds = s
, ib_tyvars = [] , ib_tyvars = []
, ib_pragmas = [] , 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, ['']) ...@@ -55,4 +55,4 @@ test('T9359', normal, compile, [''])
test('T4896', normal, compile, ['']) test('T4896', normal, compile, [''])
test('T7947', extra_clean(['T7947a.o', 'T7947a.hi', 'T7947b.o', 'T7947b.hi']), multimod_compile, ['T7947', '-v0']) test('T7947', extra_clean(['T7947a.o', 'T7947a.hi', 'T7947b.o', 'T7947b.hi']), multimod_compile, ['T7947', '-v0'])
test('T10561', normal, compile_fail, ['']) 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: ...@@ -88,84 +88,95 @@ Derived instances:
((GHC.Base..) ((GHC.Base..)
(GHC.Base.fmap GHC.Generics.unRec1) GHC.Generics.unComp1 g2) (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.datatypeName _ = "List"
GHC.Generics.moduleName _ = "GenDerivOutput" GHC.Generics.moduleName _ = "GenDerivOutput"
GHC.Generics.packageName _ = "main" 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" 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.conName _ = "Cons"
GHC.Generics.conIsRecord _ = GHC.Types.True 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" 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" 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.datatypeName _ = "Rose"
GHC.Generics.moduleName _ = "GenDerivOutput" GHC.Generics.moduleName _ = "GenDerivOutput"
GHC.Generics.packageName _ = "main" 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" 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" GHC.Generics.conName _ = "Rose"
Generic representation: Generic representation:
Generated datatypes for meta-information: Generated datatypes for meta-information:
GenDerivOutput.D1List GenDerivOutput.D1_main_GenDerivOutput_List
GenDerivOutput.C1_0List GenDerivOutput.C1_0main_GenDerivOutput_List
GenDerivOutput.C1_1List GenDerivOutput.C1_1main_GenDerivOutput_List
GenDerivOutput.S1_1_0List GenDerivOutput.S1_1_0main_GenDerivOutput_List
GenDerivOutput.S1_1_1List GenDerivOutput.S1_1_1main_GenDerivOutput_List
GenDerivOutput.D1Rose GenDerivOutput.D1_main_GenDerivOutput_Rose
GenDerivOutput.C1_0Rose GenDerivOutput.C1_0main_GenDerivOutput_Rose
GenDerivOutput.C1_1Rose GenDerivOutput.C1_1main_GenDerivOutput_Rose
GenDerivOutput.S1_1_0Rose GenDerivOutput.S1_1_0main_GenDerivOutput_Rose
GenDerivOutput.S1_1_1Rose GenDerivOutput.S1_1_1main_GenDerivOutput_Rose
Representation types: Representation types:
type GHC.Generics.Rep (GenDerivOutput.List a) = GHC.Generics.D1 type GHC.Generics.Rep (GenDerivOutput.List a) = GHC.Generics.D1
GenDerivOutput.D1List GenDerivOutput.D1_main_GenDerivOutput_List
(GHC.Generics.C1 (GHC.Generics.C1
GenDerivOutput.C1_0List GHC.Generics.U1 GenDerivOutput.C1_0main_GenDerivOutput_List
GHC.Generics.U1
GHC.Generics.:+: GHC.Generics.C1 GHC.Generics.:+: GHC.Generics.C1
GenDerivOutput.C1_1List GenDerivOutput.C1_1main_GenDerivOutput_List
(GHC.Generics.S1 (GHC.Generics.S1
GenDerivOutput.S1_1_0List GenDerivOutput.S1_1_0main_GenDerivOutput_List
(GHC.Generics.Rec0 a) (GHC.Generics.Rec0 a)
GHC.Generics.:*: GHC.Generics.S1 GHC.Generics.:*: GHC.Generics.S1
GenDerivOutput.S1_1_1List GenDerivOutput.S1_1_1main_GenDerivOutput_List
(GHC.Generics.Rec0 (GHC.Generics.Rec0
(GenDerivOutput.List (GenDerivOutput.List
a)))) a))))
type GHC.Generics.Rep1 GenDerivOutput.List = GHC.Generics.D1 type GHC.Generics.Rep1 GenDerivOutput.List = GHC.Generics.D1
GenDerivOutput.D1List GenDerivOutput.D1_main_GenDerivOutput_List
(GHC.Generics.C1 (GHC.Generics.C1
GenDerivOutput.C1_0List GHC.Generics.U1 GenDerivOutput.C1_0main_GenDerivOutput_List
GHC.Generics.U1
GHC.Generics.:+: GHC.Generics.C1 GHC.Generics.:+: GHC.Generics.C1
GenDerivOutput.C1_1List GenDerivOutput.C1_1main_GenDerivOutput_List
(GHC.Generics.S1 (GHC.Generics.S1
GenDerivOutput.S1_1_0List GenDerivOutput.S1_1_0main_GenDerivOutput_List
GHC.Generics.Par1 GHC.Generics.Par1
GHC.Generics.:*: GHC.Generics.S1 GHC.Generics.:*: GHC.Generics.S1
GenDerivOutput.S1_1_1List GenDerivOutput.S1_1_1main_GenDerivOutput_List
(GHC.Generics.Rec1 (GHC.Generics.Rec1
GenDerivOutput.List))) GenDerivOutput.List)))
type GHC.Generics.Rep (GenDerivOutput.Rose a) = GHC.Generics.D1 type GHC.Generics.Rep (GenDerivOutput.Rose a) = GHC.Generics.D1
GenDerivOutput.D1Rose GenDerivOutput.D1_main_GenDerivOutput_Rose
(GHC.Generics.C1 (GHC.Generics.C1
GenDerivOutput.C1_0Rose GHC.Generics.U1 GenDerivOutput.C1_0main_GenDerivOutput_Rose
GHC.Generics.U1
GHC.Generics.:+: GHC.Generics.C1 GHC.Generics.:+: GHC.Generics.C1
GenDerivOutput.C1_1Rose GenDerivOutput.C1_1main_GenDerivOutput_Rose
(GHC.Generics.S1 (GHC.Generics.S1
GHC.Generics.NoSelector GHC.Generics.NoSelector
(GHC.Generics.Rec0 a) (GHC.Generics.Rec0 a)
...@@ -176,11 +187,12 @@ Generic representation: ...@@ -176,11 +187,12 @@ Generic representation:
(GenDerivOutput.Rose (GenDerivOutput.Rose
a))))) a)))))
type GHC.Generics.Rep1 GenDerivOutput.Rose = GHC.Generics.D1 type GHC.Generics.Rep1 GenDerivOutput.Rose = GHC.Generics.D1
GenDerivOutput.D1Rose GenDerivOutput.D1_main_GenDerivOutput_Rose
(GHC.Generics.C1 (GHC.Generics.C1
GenDerivOutput.C1_0Rose GHC.Generics.U1 GenDerivOutput.C1_0main_GenDerivOutput_Rose
GHC.Generics.U1
GHC.Generics.:+: GHC.Generics.C1 GHC.Generics.:+: GHC.Generics.C1
GenDerivOutput.C1_1Rose GenDerivOutput.C1_1main_GenDerivOutput_Rose
(GHC.Generics.S1 (GHC.Generics.S1
GHC.Generics.NoSelector GHC.Generics.NoSelector
GHC.Generics.Par1 GHC.Generics.Par1
......
...@@ -21,46 +21,52 @@ Derived instances: ...@@ -21,46 +21,52 @@ Derived instances:
= GenDerivOutput1_0.Cons = GenDerivOutput1_0.Cons
(GHC.Generics.unPar1 g1) (GHC.Generics.unRec1 g2) (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.datatypeName _ = "List"
GHC.Generics.moduleName _ = "GenDerivOutput1_0" GHC.Generics.moduleName _ = "GenDerivOutput1_0"
GHC.Generics.packageName _ = "main" 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" 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.conName _ = "Cons"
GHC.Generics.conIsRecord _ = GHC.Types.True GHC.Generics.conIsRecord _ = GHC.Types.True