Hatena::Grouphaskell

suztomoの日記

 | 

2012-09-21

TcDeriv.lhs

23:12

==================== Derived instances ====================
Derived instances:
  instance GHC.Generics.Generic (Main.UserTree a_as1) where
    GHC.Generics.from (Main.Node g1_ax0 g2_ax1 g3_ax2)
      = GHC.Generics.M1
          (GHC.Generics.L1
             (GHC.Generics.M1
                ((GHC.Generics.:*:)
                   (GHC.Generics.M1 (GHC.Generics.K1 g1_ax0))
                   ((GHC.Generics.:*:)
                      (GHC.Generics.M1 (GHC.Generics.K1 g2_ax1))
                      (GHC.Generics.M1 (GHC.Generics.K1 g3_ax2))))))
    GHC.Generics.from Main.Leaf
      = GHC.Generics.M1
          (GHC.Generics.R1 (GHC.Generics.M1 GHC.Generics.U1))
    GHC.Generics.to
      (GHC.Generics.M1 (GHC.Generics.L1 (GHC.Generics.M1 (GHC.Generics.:*: (GHC.Generics.M1 (GHC.Generics.K1 g1_ax3))
                                                                           (GHC.Generics.:*: (GHC.Generics.M1 (GHC.Generics.K1 g2_ax4))
                                                                                             (GHC.Generics.M1 (GHC.Generics.K1 g3_ax5)))
))))
      = Main.Node g1_ax3 g2_ax4 g3_ax5
    GHC.Generics.to
      (GHC.Generics.M1 (GHC.Generics.R1 (GHC.Generics.M1 GHC.Generics.U1)))
      = Main.Leaf


  instance GHC.Show.Show Main.Bin where
    GHC.Show.showsPrec _ Main.O = GHC.Show.showString "O"
    GHC.Show.showsPrec _ Main.I = GHC.Show.showString "I"
    GHC.Show.showList = GHC.Show.showList__ (GHC.Show.showsPrec 0)

  instance GHC.Generics.Datatype Main.D1UserTree where
    GHC.Generics.datatypeName _ = "UserTree"
    GHC.Generics.moduleName _ = "Main"

  instance GHC.Generics.Constructor Main.C1_0UserTree where
    GHC.Generics.conName _ = "Node"

  instance GHC.Generics.Constructor Main.C1_1UserTree where
    GHC.Generics.conName _ = "Leaf"


Generic representation:

  Generated datatypes for meta-information:
    Main.D1UserTree
    Main.C1_0UserTree
    Main.C1_1UserTree
    Main.S1_0_0UserTree
    Main.S1_0_1UserTree
    Main.S1_0_2UserTree

  Representation types:
    type GHC.Generics.Rep (Main.UserTree a_as1) = GHC.Generics.D1
                                                    Main.D1UserTree
                                                    (GHC.Generics.C1
                                                       Main.C1_0UserTree
                                                       (GHC.Generics.S1
                                                          GHC.Generics.NoSelector
                                                          (GHC.Generics.Rec0 a_as1)
                                                        GHC.Generics.:*: (GHC.Generics.S1
                                                                            GHC.Generics.NoSelector
                                                                            (GHC.Generics.Rec0
                                                                               (Main.UserTree
                                                                                  a_as1))
                                                                          GHC.Generics.:*: GHC.Generics.S1
                                                                                             GHC.Generics.NoSelector
                                                                                             (GHC.Generics.Rec0
                                                                                                (Main.UserTree
                                                                                                   a_as1))))
                                                     GHC.Generics.:+: GHC.Generics.C1
                                                                        Main.C1_1UserTree
                                                                        GHC.Generics.U1)

はここからきてる。

tcDeriving  :: [LTyClDecl Name]  -- All type constructors
            -> [LInstDecl Name]  -- All instance declarations
            -> [LDerivDecl Name] -- All stand-alone deriving declarations
            -> TcM (TcGblEnv, Bag (InstInfo Name), HsValBinds Name)
tcDeriving tycl_decls inst_decls deriv_decls
  = recoverM (do { g <- getGblEnv
                 ; return (g, emptyBag, emptyValBindsOut)}) $
    do	{   	-- Fish the "deriving"-related information out of the TcEnv
		-- And make the necessary "equations".
	  is_boot <- tcIsHsBoot
	; traceTc "tcDeriving" (ppr is_boot)
	; early_specs <- makeDerivSpecs is_boot tycl_decls inst_decls deriv_decls

        -- for each type, determine the auxliary declarations that are common
        -- to multiple derivations involving that type (e.g. Generic and
        -- Generic1 should use the same TcGenGenerics.MetaTyCons)
        ; (commonAuxs, auxDerivStuff) <- commonAuxiliaries $ map (either id id) early_specs

	; overlap_flag <- getOverlapFlag
	; let (infer_specs, given_specs) = splitEithers early_specs
	; insts1 <- mapM (genInst True overlap_flag commonAuxs) given_specs

        -- the stand-alone derived instances (@insts1@) are used when inferring
        -- the contexts for "deriving" clauses' instances (@infer_specs@)
	; final_specs <- extendLocalInstEnv (map (iSpec . fst) insts1) $
                           inferInstanceContexts overlap_flag infer_specs

	; insts2 <- mapM (genInst False overlap_flag commonAuxs) final_specs

        ; let (inst_infos, deriv_stuff) = unzip (insts1 ++ insts2)
        ; loc <- getSrcSpanM
        ; let (binds, newTyCons, famInsts, extraInstances) = 
                genAuxBinds loc (unionManyBags (auxDerivStuff : deriv_stuff))

        ; (inst_info, rn_binds, rn_dus) <-
            renameDeriv is_boot (inst_infos ++ (bagToList extraInstances)) binds

        ; dflags <- getDynFlags
        ; unless (isEmptyBag inst_info) $
            liftIO (dumpIfSet_dyn dflags Opt_D_dump_deriv "Derived instances"
                   (ddump_deriving inst_info rn_binds newTyCons famInsts))

        ; let all_tycons = map ATyCon (bagToList newTyCons)
        ; gbl_env <- tcExtendGlobalEnv all_tycons $
                     tcExtendGlobalEnvImplicit (concatMap implicitTyThings all_tycons) $
                     tcExtendLocalFamInstEnv (bagToList famInsts) $
                     tcExtendLocalInstEnv (map iSpec (bagToList inst_info)) getGblEnv

        ; return (addTcgDUs gbl_env rn_dus, inst_info, rn_binds) }
  where
    ddump_deriving :: Bag (InstInfo Name) -> HsValBinds Name 
                   -> Bag TyCon    -- ^ Empty data constructors
                   -> Bag FamInst  -- ^ Rep type family instances
                   -> SDoc
    ddump_deriving inst_infos extra_binds repMetaTys repFamInsts
      =    hang (ptext (sLit "Derived instances:"))
              2 (vcat (map (\i -> pprInstInfoDetails i $$ text "") (bagToList inst_infos))
                 $$ ppr extra_binds)
        $$ hangP "Generic representation:" (
              hangP "Generated datatypes for meta-information:"
               (vcat (map ppr (bagToList repMetaTys)))
           $$ hangP "Representation types:"
                (vcat (map pprRepTy (bagToList repFamInsts))))

    hangP s x = text "" $$ hang (ptext (sLit s)) 2 x

MarinelleMarinelle2013/03/30 03:21I'd love to see a high level overview of the vaouirs type extensions for ghc. I've no idea when I should or could be considering GADTs, or type families, or functional dependencies, or There seems to be decent detailed information about each of these, which can be overwhelming when you're not sure where to start. I'd like to know how these extensions relate to each other; do they solve the same problems, or are they mutually exclusive?

bnobttrbnobttr2013/03/30 16:24FdzaUd <a href="http://xdshxqestxuc.com/">xdshxqestxuc</a>

fhzvzvjfhzvzvj2013/03/31 23:43jLB6T8 , [url=http://jgivvbvlxcdm.com/]jgivvbvlxcdm[/url], [link=http://sxducmyqobpx.com/]sxducmyqobpx[/link], http://mhyhrnoiwjse.com/

luzzypluzzyp2013/04/02 08:56cqGmbB , [url=http://xzaspwbxvpja.com/]xzaspwbxvpja[/url], [link=http://lpdyucheicmx.com/]lpdyucheicmx[/link], http://tfxnggdqanke.com/

花痴花痴2013/09/03 18:28花痴:http://花痴.happykanpo.com
花痴:http://xn--dtyr5y.happykanpo.com
花痴:http://xn--dtyr5y.happykanpo.com
威哥王:http://www.onbape.com
イカオウ:http://www.onbape.com
紅蜘蛛:http://www.shkanpo.com
紅蜘蛛:http://www.shkanpo.com
三便宝:http://www.hellokanpo.com/view/satibo-capsules.html
RU486:http://www.hellokanpo.com/view/beijing-ru486.html



威哥王:http://www.hellokanpo.com/view/weigewang.html
巨人倍増:http://www.hellokanpo.com/view/jurenbeiceng.html
三便宝:http://www.hellokanpo.com/view/satibo-capsules.html
D10 媚薬:http://www.hellokanpo.com/view/D10-meiyao.html
RU486:http://www.hellokanpo.com/view/beijing-ru486.html
花痴:http://www.hellokanpo.com/view/huachi.html
紅蜘蛛:http://www.hellokanpo.com/view/hongzhizhu1.html

威哥王:http://www.hellokanpo.com/view/weigewang.html
巨人倍増:http://www.hellokanpo.com/view/jurenbeiceng.html
三便宝:http://www.hellokanpo.com/view/satibo-capsules.html
D10 媚薬:http://www.hellokanpo.com/view/D10-meiyao.html
さんべんぼう:http://www.hellokanpo.com/view/satibo-capsules.html
イーリーシン:http://www.hellokanpo.com/view/yilishen.html
狼一号:http://www.hellokanpo.com/view/langyihao.html
三體牛鞭:http://www.hellokanpo.com/view/santiniubian.html
D10 催情剤:http://www.hellokanpo.com/view/D10-meiyao.html
三体牛鞭:http://www.hellokanpo.com/view/santiniubian.html
RU486:http://www.hellokanpo.com/view/beijing-ru486.html
韓国痩身1号:http://www.hellokanpo.com/view/hanguoshou-575.html
紅蜘蛛:http://www.hellokanpo.com/view/hongzhizhu1.html


精力剤:http://www.hellokanpo.com/JingLiJi
媚薬:http://www.hellokanpo.com/meiyao
威哥王:http://www.hellokanpo.com/view/weigewang.html
巨人倍増:http://www.hellokanpo.com/view/jurenbeiceng.html
天天素:http://www.hellokanpo.com/view/tiantiansu.html
三便宝:http://www.hellokanpo.com/view/satibo-capsules.html
蟻力神:http://www.hellokanpo.com/view/yilishen.html
RU486:http://www.hellokanpo.com/view/beijing-ru486.html
韓国痩身1号:http://www.hellokanpo.com/view/hanguoshou-575.html
D10 媚薬:http://www.hellokanpo.com/view/D10-meiyao.html
福源春:http://www.hellokanpo.com/view/fuyuanchun.html
狼一号:http://www.hellokanpo.com/view/langyihao.html
花痴:http://www.hellokanpo.com/view/huachi.html
紅蜘蛛:http://www.hellokanpo.com/view/hongzhizhu1.html
巨根カプセル:http://www.hellokanpo.com/view/jugen.html
三體牛鞭:http://www.hellokanpo.com/view/santiniubian.html
三体牛鞭:http://www.hellokanpo.com/view/santiniubian.html
絶對高潮:http://www.hellokanpo.com/view/jueduigaochao.html
SEX DROPS:http://www.hellokanpo.com/view/sex-drops.html
D10 催情剤:http://www.hellokanpo.com/view/D10-meiyao.html
終極痩身:http://www.hellokanpo.com/view/zhongjishoushen.html
超級脂肪燃焼弾:http://www.hellokanpo.com/view/FATBURNING.html
SUPER FAT BURNING:http://www.hellokanpo.com/view/SUPERFATBURNING.html
D5 原液:http://www.hellokanpo.com/view/FLYD5yuan.html
新一粒神:http://www.hellokanpo.com/view/xinyilishen.html
ビグレックス:http://www.hellokanpo.com/view/Oil.html
蔵八宝:http://www.hellokanpo.com/view/zhangbabao.html
御秀堂:http://www.hellokanpo.com/view/yuxiutang.html
中絶薬:http://www.hellokanpo.com/zhongjue


イーリーシン:http://www.hellokanpo.com/view/yilishen.html
ED助勃:http://www.hellokanpo.com
催情:http://www.hellokanpo.com/view/D10-meiyao.html
五便宝:http://www.hellokanpo.com/view/wodibo-capsules.html
キョジンバイゾウ:http://www.hellokanpo.com/view/jurenbeiceng.html
蒼蝿水:http://www.hellokanpo.com/view/FLY-D5.html
VigRx:http://www.hellokanpo.com/view/VigRx.html
ウェイカワン:http://www.hellokanpo.com/view/weigewang.html
VVK:http://www.hellokanpo.com/view/VVK-Wenickman.html
狼1号:http://www.hellokanpo.com/view/langyihao.html
男宝:http://www.hellokanpo.com/view/nanbao.html
vigRx oil:http://www.hellokanpo.com/view/Oil.html
曲美:http://www.hellokanpo.com/view/qumei.html
SPANISCHE FLIEGE:http://www.hellokanpo.com/view/spanische-flieged5-1.html
Wenickman:http://www.hellokanpo.com/view/VVK-Wenickman.html
FLY D5:http://www.hellokanpo.com/view/FLY-D5.html
ペニス増大:http://www.hellokanpo.com/JingLiJi/xingqi.html
蟻王:http://www.hellokanpo.com/view/antking.html
ナンパオ:http://www.hellokanpo.com/view/nanbao.html
ベニクモ:http://www.hellokanpo.com/view/hong-zhi-zhu.html
韓国痩身一号:http://www.hellokanpo.com/view/hanguoshou-575.html
ハナチ:http://www.hellokanpo.com/view/huachi.html
セックスドロップ:http://www.hellokanpo.com/view/sex-drops.html
男根増長素:http://www.hellokanpo.com/view/nangen.html
三鞭粒:http://www.hellokanpo.com/view/wei.html
九鞭粒:http://www.hellokanpo.com/view/jiubianli.html
V26:http://www.hellokanpo.com/view/V26.html
日本秀身堂:http://www.hellokanpo.com/view/xouzhentang.html
procomil spray:http://www.hellokanpo.com/view/procomil-spray.html
性霸2000:http://www.hellokanpo.com/view/xingba2000.html
魔根:http://www.hellokanpo.com/view/muogen.html
花之欲:http://www.hellokanpo.com/view/huazhiyu.html
Xing霸:http://www.hellokanpo.com/view/xingba2000.html
美人豹:http://www.hellokanpo.com/view/meirenbao.html
アリ王:http://www.hellokanpo.com/view/antking.html
男露888:http://www.hellokanpo.com/view/nanlu888.html
消渇丸:http://www.hellokanpo.com/view/xiaokewan.html
西班牙昆虫粉:http://www.hellokanpo.com/view/kunchong-fen.html
壮三天:http://www.hellokanpo.com/view/zhuangsantian.html
モチベーター:http://www.hellokanpo.com/view/Motivat.html
motivator:http://www.hellokanpo.com/view/Motivat.html
早漏防止:http://www.hellokanpo.com/JingLiJi/zaoxie.html
漢方薬 通販:http://www.hellokanpo.com/hanfang
ED治療薬:http://www.hellokanpo.com
勃起促進:http://www.hellokanpo.com/view/weigewang.html
女性用媚薬:http://www.hellokanpo.com/meiyao
漢方ダイエット:http://www.hellokanpo.com/jianfei/hfjianfei.html
ダイエット薬:http://www.hellokanpo.com/jianfei/xinchendaixie.html
さんべんぼう:http://www.hellokanpo.com/view/satibo-capsules.html
リドスプレー:http://www.hellokanpo.com/view/Lidosprayer.html
イカオウ:http://www.hellokanpo.com/view/weigewang.html
きょくび:http://www.hellokanpo.com/view/qumei.html
威哥王:http://www.hellokanpo.com/view/weigewang.html
巨人倍増:http://www.hellokanpo.com/view/jurenbeiceng.html
三便宝:http://www.hellokanpo.com/view/satibo-capsules.html
D10 媚薬:http://www.hellokanpo.com/view/D10-meiyao.html
RU486:http://www.hellokanpo.com/view/beijing-ru486.html
紅蜘蛛:http://www.hellokanpo.com/view/hongzhizhu1.html
威哥王 販売:http://www.hellokanpo.com/view/weigewang.html
紅蜘蛛 液体:http://www.hellokanpo.com/view/hong-zhi-zhu.html
紅蜘蛛 激安:http://www.hellokanpo.com/view/hong-zhi-zhu-meiyao.html
三便宝 激安:http://www.hellokanpo.com/view/satibo-capsules5.html
三便宝 販売:http://www.hellokanpo.com/view/satibo-capsules.html

RUSHRUSH2015/05/28 22:40RUSH : http://www.xn--jfrz33iqmo.com/
芳香劑 : http://www.xn--jfrz33iqmo.com/
RUSH : http://www.xn--jfrz33iqmo.com/Rush-Class.asp?id=1
芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-Class.asp?id=1
カナダ 芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-xClass.asp?id=2
ブリテン 芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-xClass.asp?id=3
米国 Rush 芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-xClass.asp?id=4
RUSH 20%濃度 芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-xClass.asp?id=5
芳香劑 40%濃度 RUSH : http://www.xn--jfrz33iqmo.com/Rush-xClass.asp?id=6
RUSH 10ml 芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-xClass.asp?id=7
RUSH 30ml 芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-xClass.asp?id=8
RUSH 60ml 芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-xClass.asp?id=9
香水型 Rush 芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-xClass.asp?id=10
SLEEK 情愛芳香劑 RUSH 正品 : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=6
RUSH PUSH 芳香劑 : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=2
芳香劑 ULTRA RUSH : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=1
Rush 芳香劑 青アップル香水の棒スーツ : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=38
PIG レモン香水の棒スーツ 芳香劑 RUSH : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=37
Hell FIRE 芳香劑 40%濃度 古龍王香水の棒 : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=36
芳香劑 IRON HORSE ジャスミン香水の棒スーツ : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=35
芳香劑 Super Juice ジャスミン香水の棒スーツ : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=34
GUSH レモン香水の棒スーツ 芳香劑 RUSH : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=33
芳香劑 Rush 20%濃度 香水の棒スーツ : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=32
X ME 芳香劑 古龍王香水の棒 (贈り物のスーツ) : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=31
NITRO 芳香劑 青アップル香水の棒 スーツ : http://www.xn--jfrz33iqmo.com/Rush-Product.asp?id=30

瑞徳夢減肥茶瑞徳夢減肥茶2015/05/28 22:43瑞徳夢減肥茶: http://www.buyslimming.com/Product.asp?id=26
果然痩身(全身痩ダイエット) : http://www.buyslimming.com/Product.asp?id=25
痩身の語 第2代 : http://www.buyslimming.com/Product.asp?id=24
V26Ⅱ即効ダイエット: http://www.buyslimming.com/Product.asp?id=22
唯美OB蛋白痩身素 第4代 : http://www.buyslimming.com/Product.asp?id=21
痩身の語(第三代) : http://www.buyslimming.com/Product.asp?id=20
V26即効ダイエット : http://www.buyslimming.com/Product.asp?id=18
唯美OB蛋白痩身素 新2代 : http://www.buyslimming.com/Product.asp?id=17
SLIMING BOMB強力脂肪燃焼カプセル : http://www.buyslimming.com/Product.asp?id=15
紐斯葆濃縮藤黄果カプセル : http://www.buyslimming.com/Product.asp?id=14
韓国緑素抗脂カプセル : http://www.buyslimming.com/Product.asp?id=13
康亭CONT繊維素 : http://www.buyslimming.com/Product.asp?id=11
激痩強化痩身丸: http://www.buyslimming.com/Product.asp?id=10
大印象減肥茶 : http://www.buyslimming.com/Product.asp?id=9
野茶果: http://www.buyslimming.com/Product.asp?id=8
7日痩: http://www.buyslimming.com/Product.asp?id=7
韓国痩身1号: http://www.buyslimming.com/Product.asp?id=6
修身堂神奇修身減肥コーヒー : http://www.buyslimming.com/Product.asp?id=5
超級脂肪燃焼弾 第4代 : http://www.buyslimming.com/Product.asp?id=4
妙姿ダイエット: http://www.buyslimming.com/Product.asp?id=3
V26 即効 腹ダイエット : http://www.buyslimming.com/Product.asp?id=2
超級脂肪燃焼弾 第2代 : http://www.buyslimming.com/Product.asp?id=1

 |