[commit: ghc] master: Clarify seq documentation (4e22220)

git at git.haskell.org git at git.haskell.org
Wed Sep 13 20:54:51 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4e222203751e50e3c35815376090b2951bf7c9e0/ghc

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

commit 4e222203751e50e3c35815376090b2951bf7c9e0
Author: Sibi Prabakaran <sibi at psibi.in>
Date:   Wed Sep 13 12:33:22 2017 -0400

    Clarify seq documentation
    
    Improves the documentation by specifying that the first argument in
    seq function is evaluated to WHNF.
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: harendra, rwbarton, thomie
    
    GHC Trac Issues: #14213
    
    Differential Revision: https://phabricator.haskell.org/D3945


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

4e222203751e50e3c35815376090b2951bf7c9e0
 compiler/prelude/primops.txt.pp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp
index 8039913..8e020c4 100644
--- a/compiler/prelude/primops.txt.pp
+++ b/compiler/prelude/primops.txt.pp
@@ -2817,8 +2817,9 @@ pseudoop "proxy#"
 pseudoop   "seq"
    a -> b -> b
    { The value of {\tt seq a b} is bottom if {\tt a} is bottom, and
-     otherwise equal to {\tt b}. {\tt seq} is usually introduced to
-     improve performance by avoiding unneeded laziness.
+     otherwise equal to {\tt b}. In other words, it evaluates the first 
+     argument {\tt a} to weak head normal form (WHNF). {\tt seq} is usually 
+     introduced to improve performance by avoiding unneeded laziness.
 
      A note on evaluation order: the expression {\tt seq a b} does
      {\it not} guarantee that {\tt a} will be evaluated before {\tt b}.



More information about the ghc-commits mailing list