[Haskell-cafe] Re: Re: Re: Do expression definition

Ben Franksen ben.franksen at online.de
Fri Sep 17 16:04:20 EDT 2010


wren ng thornton wrote:
> On 9/16/10 4:59 PM, Ben Franksen wrote:
>> even though we always have
>>
>>    (\x ->  e) y == let x = y in e
>>
>> which means that let can be translated to lambda, the converse is not
>> true,
> 
> Not exactly. Note that when compilers do CPS conversion, everything is
> converted into let-binding and continuations (i.e., longjump/goto with
> value passing). It's just dual to the everything-is-lambda world,
> nothing special.

I meant "not possible" as in "by a source-to-source transformation in a
simple core-ML-like language" (such as is used in most introductions to
HM-style type inference). If you translate to a language with mutable state
and/or built-in continuations then things are different, of course.

Do you know a good online introduction to CPS conversion that explains the
kind of duality you mentioned?

Cheers
Ben



More information about the Haskell-Cafe mailing list