[commit: ghc] master: Comments on oneShot (3a71d78)
git at git.haskell.org
git at git.haskell.org
Fri Sep 11 16:17:13 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/3a71d78156ed9422b7642bfbd665978ea3de7f89/ghc
>---------------------------------------------------------------
commit 3a71d78156ed9422b7642bfbd665978ea3de7f89
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Aug 27 16:23:46 2015 +0100
Comments on oneShot
>---------------------------------------------------------------
3a71d78156ed9422b7642bfbd665978ea3de7f89
compiler/basicTypes/MkId.hs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs
index 36d0794..698c865 100644
--- a/compiler/basicTypes/MkId.hs
+++ b/compiler/basicTypes/MkId.hs
@@ -1326,6 +1326,10 @@ and Note [Left folds via right fold]) it was determined that it would be useful
if library authors could explicitly tell the compiler that a certain lambda is
called at most once. The oneShot function allows that.
+'oneShot' is open kinded, i.e. the type variables can refer to unlifted
+types as well (Trac #10744); e.g.
+ oneShot (\x:Int# -> x +# 1#)
+
Like most magic functions it has a compulsary unfolding, so there is no need
for a real definition somewhere. We have one in GHC.Magic for the convenience
of putting the documentation there.
More information about the ghc-commits
mailing list