[commit: ghc] wip/T12618: mkSimpleDataConRep: No wrapper for newtypes (48877da)

git at git.haskell.org git at git.haskell.org
Thu Oct 6 23:21:09 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T12618
Link       : http://ghc.haskell.org/trac/ghc/changeset/48877dad6bfd8a7d5cf47da04fde8e2223530146/ghc

>---------------------------------------------------------------

commit 48877dad6bfd8a7d5cf47da04fde8e2223530146
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Oct 5 18:21:59 2016 -0400

    mkSimpleDataConRep: No wrapper for newtypes


>---------------------------------------------------------------

48877dad6bfd8a7d5cf47da04fde8e2223530146
 compiler/basicTypes/MkId.hs | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs
index 0601ba4..ba7b633 100644
--- a/compiler/basicTypes/MkId.hs
+++ b/compiler/basicTypes/MkId.hs
@@ -472,11 +472,13 @@ unitDataConBoxer :: DataConBoxer
 unitDataConBoxer = DCB (\_ vs -> return (vs, []))
 
 mkSimpleDataConRep :: Name -> DataCon -> DataConRep
-mkSimpleDataConRep wrap_name dc = DCR { dcr_wrap_id = wrap_id
-                                      , dcr_boxer   = unitDataConBoxer
-                                      , dcr_arg_tys = arg_tys
-                                      , dcr_stricts = rep_strs
-                                      , dcr_bangs   = arg_ibangs }
+mkSimpleDataConRep _ dc | isNewTyCon (dataConTyCon dc) = NoDataConRep
+mkSimpleDataConRep wrap_name dc
+    = DCR { dcr_wrap_id = wrap_id
+          , dcr_boxer   = unitDataConBoxer
+          , dcr_arg_tys = arg_tys
+          , dcr_stricts = rep_strs
+          , dcr_bangs   = arg_ibangs }
   where
     wrap_ty = dataConRepType dc
     wrap_id = mkGlobalId (DataConWrapId dc) wrap_name wrap_ty wrap_info



More information about the ghc-commits mailing list