[Git][ghc/ghc][wip/T23146] Fix inconsistencies in code comments

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Fri May 19 12:46:33 UTC 2023



Rodrigo Mesquita pushed to branch wip/T23146 at Glasgow Haskell Compiler / GHC


Commits:
4d5cd5ac by Matthew Craven at 2023-05-19T12:46:31+00:00
Fix inconsistencies in code comments
- - - - -


3 changed files:

- compiler/GHC/Core.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Stg/Syntax.hs


Changes:

=====================================
compiler/GHC/Core.hs
=====================================
@@ -397,8 +397,7 @@ constructor worker or wrapper
       we generate
              S1 :: S   -- A top-level unlifted binding
              S1 = S1
-      We allow this top-level unlifted binding to exist, after CorePrep
-      only.
+      We allow this top-level unlifted binding to exist.
 
 Note [Core let-can-float invariant]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


=====================================
compiler/GHC/Core/DataCon.hs
=====================================
@@ -627,8 +627,8 @@ For example:
 The arity might also differ due to unpacking, for example, consider the
 following datatype and its wrapper and worker's type:
    data V = MkV !() !Int
-   $WV :: () -> Int -> V
-     V :: Int# -> V
+   $WMkV :: () -> Int -> V
+     MkV :: Int# -> V
 As you see, because of unpacking we have both dropped the unit argument and
 unboxed the Int. In this case, the source arity (which is the arity of the
 wrapper) is 2, while the Core representation arity (the arity of the worker) is 1.


=====================================
compiler/GHC/Stg/Syntax.hs
=====================================
@@ -255,20 +255,20 @@ documents that design choice.
 
 As an example, consider:
 
-        data T a = MkT Int! a Void#
+        data T a = MkT !Int a Void#
 
 The wrapper's representation and the worker's representation (i.e. the
 datacon's Core representation) are respectively:
 
-        $WT :: Int  -> a -> Void# -> T a
-        T   :: Int# -> a -> Void# -> T a
+        $WMkT :: Int  -> a -> Void# -> T a
+        MkT   :: Int# -> a -> Void# -> T a
 
 T would end up being used in STG post-unarise as:
 
-  let x = T 1# y
+  let x = MkT 1# y
   in ...
       case x of
-        T int a -> ...
+        MkT int a -> ...
 
 The Void# argument is dropped. In essence we only generate binders for runtime
 relevant values.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4d5cd5acadba24f41b74f8fc559bae25abd4e9bc

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4d5cd5acadba24f41b74f8fc559bae25abd4e9bc
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230519/44a6a455/attachment-0001.html>


More information about the ghc-commits mailing list