Call-by-name lambda-calculus is strictly more expressive (in Felleisen
sense) than call-by-value lambda-calculus, and the call-by-need (aka, lazy)
lambda-calculus is observationally equivalent to the call-by-name.
One can add shift/reset to any of these calculi (CBV shift/reset is
most known;
On Sat, Feb 23, 2008 at 1:05 AM, [EMAIL PROTECTED] wrote:
Adding control effects (shift/reset) changes the expressivity
results. Now all three calculi are distinct and none subsumes the
other. For example, the expression
reset( (\x - 1) (abort 2))
evaluates to 1 in call-by-name
On Sat, Feb 23, 2008 at 1:05 AM, [EMAIL PROTECTED] wrote:
reset ((\x - x + x) (shift f f))
This one doesn't typecheck, since you can't unify the types (a - r) and r.
--
Taral [EMAIL PROTECTED]
Please let me know if there's any further trouble I can give you.
-- Unknown
My understanding of these things is limited, but what would stop me,
theoretically speaking, of making a version of ghc with these
primitives added:
type Prompt r
reset :: (Prompt r - r) - r
shift :: Prompt r - ((a - _) - r) - a
(Where _ is either r or forall b. b)
--
Taral [EMAIL PROTECTED]
You might want to take a look at
http://www.haskell.org/pipermail/haskell/2007-December/020034.html
which shows an implementation of delimited continuations in Haskell98
and possibly gets rid of any requirement of implementing primitives.
-- ryan
On 2/22/08, Taral [EMAIL PROTECTED] wrote:
My
See also,
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CC-delcont
An implementation of multi-prompt delimited continuations based on the
paper, A Monadic Framework for Delimited Continuations, by R. Kent
Dybvig, Simon Peyton Jones and Amr Sabry
reset :: MonadDelimitedCont