diff options
author | Sibi Prabakaran <sibi@psibi.in> | 2017-09-13 12:33:22 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-09-13 16:45:50 -0400 |
commit | 4e222203751e50e3c35815376090b2951bf7c9e0 (patch) | |
tree | 981f6b0299cd2e160ec73e4c51eab008bd2944f7 /compiler | |
parent | 4be195e707d5e079dca5b6ce2e6cd34ff7624adf (diff) | |
download | haskell-4e222203751e50e3c35815376090b2951bf7c9e0.tar.gz |
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
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/prelude/primops.txt.pp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 8039913110..8e020c44d1 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}. |