diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-13 18:14:55 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-09-13 18:20:18 +0200 |
commit | abff2ffd2d6e30b93daa0def282b9fc0795ad10d (patch) | |
tree | b15b7c23862b9526d7e805616592228b704b2649 /compiler | |
parent | 6999223fbb95046fe08562559bba1fdeb7d16795 (diff) | |
download | haskell-abff2ffd2d6e30b93daa0def282b9fc0795ad10d.tar.gz |
Move docstring of `seq` to primops.txt.pp
The documentation for `seq` was recently augmented via #9390 &
cbfa107604f4cbfaf02bd633c1faa6ecb90c6dd7. However, it doesn't show
up in the Haddock generated docs because `#ifdef __HADDOCK__` doesn't
work as expected. Also, it's easier to just fix the problem at the
origin (which in this is case is the primops.txt.pp file).
The benefit/downside of this is that now the extended documentation
shows up everywhere `seq` is re-exported directly.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/prelude/primops.txt.pp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index d5566fe363..b1a42b3d1f 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2551,8 +2551,17 @@ pseudoop "proxy#" pseudoop "seq" a -> b -> b - { Evaluates its first argument to head normal form, and then returns its second - argument as the result. } + { 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. + + A note on evaluation order: the expression {\tt seq a b} does + {\it not} guarantee that {\tt a} will be evaluated before {\tt b}. + The only guarantee given by {\tt seq} is that the both {\tt a} + and {\tt b} will be evaluated before {\tt seq} returns a value. + In particular, this means that {\tt b} may be evaluated before + {\tt a}. If you need to guarantee a specific order of evaluation, + you must use the function {\tt pseq} from the "parallel" package. } primtype Any { The type constructor {\tt Any} is type to which you can unsafely coerce any |