Changes between Initial Version and Version 1 of Ticket #7994, comment 7


Ignore:
Timestamp:
Jan 24, 2014 4:19:14 PM (6 years ago)
Author:
nomeata
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7994, comment 7

    initial v1  
    33Instead of trying hard to make the compiler sufficiently smart, why not help him a little bit? So here is what I did:
    44
    5 I created a new magic function `oneShot` (similar to `lazy` etc.). Semantically, `oneShot = λ f λ x. f x", but the unfolding will put a `OneShot` on the binder for x. So essentially, it allows the programmer to tell the compiler: I promise I will only call this function once (and if I break my promise, I won’t blame you).
     5I created a new magic function `oneShot` (similar to `lazy` etc.). Semantically, `oneShot = λ f λ x. f x`, but the unfolding will put a `OneShot` annotation on the binder for x. So essentially, it allows the programmer to tell the compiler: I promise I will only call this function once (and if I break my promise, I won’t blame you).
    66
    77So now one would define