Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Ara Adkins
Glasgow Haskell Compiler
Commits
3a71d781
Commit
3a71d781
authored
Aug 27, 2015
by
Simon Peyton Jones
Browse files
Comments on oneShot
parent
cdca31eb
Changes
1
Show whitespace changes
Inline
Side-by-side
compiler/basicTypes/MkId.hs
View file @
3a71d781
...
@@ -1326,6 +1326,10 @@ and Note [Left folds via right fold]) it was determined that it would be useful
...
@@ -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
if library authors could explicitly tell the compiler that a certain lambda is
called at most once. The oneShot function allows that.
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
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
for a real definition somewhere. We have one in GHC.Magic for the convenience
of putting the documentation there.
of putting the documentation there.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment