Re: [Haskell] Importance of precise lazy-evaluation semantics (was: line-based interactive program)

2005-07-08 Thread Jan-Willem Maessen
On Jul 8, 2005, at 10:20 AM, Jean-Philippe Bernardy wrote (in an exchange with Colin Runciman): My interaction depends on the (subtle order of) evaluation of a pure and total function? Pure, yes; total, no. Many important things depend on order of evaluation in lazy programs: for example,

Re: [Haskell] Importance of precise lazy-evaluation semantics (was: line-based interactive program)

2005-07-08 Thread Thomas Davie
It seems to me that this sort of thing is why haskell is difficult to compile to efficient code. I have the impression that relaxed semantics wouldn't hurt 99% of programs while make the compiler-writer job easier. The only disadvantage is that tricks like the above one wouldn't work any more. An

[Haskell] Importance of precise lazy-evaluation semantics (was: line-based interactive program)

2005-07-08 Thread Jean-Philippe Bernardy
> >>My interaction depends on the (subtle order of) evaluation of a pure and > >>total function? > >> > Pure, yes; total, no. > > Many important things depend on order of evaluation in lazy programs: > for example, whether they compute a well-defined value at all! The > interleaving of demand in

Re: [Haskell] Lazy evaluation

2004-10-07 Thread Jules Bean
On 7 Oct 2004, at 22:14, Amadeo Casas Cuadrado wrote: Hello, Could anyone tell me where can i find a webpage or a paper about how lazy implementation is done is Haskell? For much more than you could ever want to know about haskell, look in Simon Peyton Jones's page: http://research.microsoft.co

[Haskell] Lazy evaluation

2004-10-07 Thread Amadeo Casas Cuadrado
Hello, Could anyone tell me where can i find a webpage or a paper about how lazy implementation is done is Haskell? Thanks a lot! --Ama ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Lazy evaluation alternative

2003-01-26 Thread Keith Wansbrough
> I wonder if I could run an idea I've had by this list. It seems to > me you could get some of the desired effects of lazy evaluation by using > continuation passing style in code. For example, take this psuedo-code > using CPS to represent an infinite data type. This has

Re: Lazy evaluation alternative

2003-01-24 Thread Chris Clearwater
On Fri, Jan 24, 2003 at 09:18:47AM -0600, Kevin S. Millikin wrote: > > "Chris" == Chris Clearwater <[EMAIL PROTECTED]> writes: > > Chris> LIAR. You want to steal my idea for yourself! It's MINE! :) > > I hate to be the one to break it to you, but we used to routinely show > this trick to

Re: Lazy evaluation alternative

2003-01-24 Thread Nick Name
On Fri, 24 Jan 2003 09:18:47 -0600 "Kevin S. Millikin" <[EMAIL PROTECTED]> wrote: > > So your trick *is* used to implement lazy evaluation in other > languages. It's not very pleasant if you write a lot of lazy code, > because you have to explicitly s

Re: Lazy evaluation alternative

2003-01-24 Thread Jerzy Karczmarczuk
ons-stream, etc.), or just the lambda-ification, as proposed by Kevin Millikin. It is not even clear *to what* you should apply your continuation. However, Kevin S Millikin is too pessimistic about So your trick *is* used to implement lazy evaluation in other languages. It's not very pleasant

Re: Lazy evaluation alternative

2003-01-24 Thread Kevin S. Millikin
# > (ones) (1 . #) > (cdr (ones)) # > ((cdr (ones))) (1 . #) Of course, if we wanted *lazy* evaluation, we would want to avoid performing the cons more than once if it is demanded more than once. We have to use something other than lambda for that: > (define ones (delay (begin (printf

Re: Lazy evaluation alternative

2003-01-24 Thread Kevin S. Millikin
> "Chris" == Chris Clearwater <[EMAIL PROTECTED]> writes: Chris> But also, this brings me to another idea! Data structures Chris> should be built from lambdas and CPS! For example, a list Chris> of integers: 1 : 2 : 3 Chris> list = \c -> c 1 (\c -> c 2 nil) How about just:

Re: Lazy evaluation alternative

2003-01-24 Thread Chris Clearwater
On Fri, Jan 24, 2003 at 03:07:48PM +0100, Thomas Johnsson wrote: > > > > > Yes I am. But the + should be in CPS form anyways to be perfectly > > correct, so: natural n c = (+) n 1 (\m -> c n : (natural m)) > > > > I think Jerzy (in his usual polite manner :-) refers to the every group has

Re: Lazy evaluation alternative

2003-01-24 Thread Chris Clearwater
On Fri, Jan 24, 2003 at 01:51:57PM +0100, Jerzy Karczmarczuk wrote: > Chris Clearwater wrote: > >It seems to > >me you could get some of the desired effects of lazy evaluation by using > >continuation passing style in code. For example, take this psuedo-code > >using C

Re: Lazy evaluation alternative

2003-01-24 Thread Martin Norbäck
fre 2003-01-24 klockan 13.21 skrev Chris Clearwater: > I wonder if I could run an idea I've had by this list. It seems to > me you could get some of the desired effects of lazy evaluation by using > continuation passing style in code. For example, take this psuedo-code > using

Lazy evaluation alternative

2003-01-24 Thread Chris Clearwater
I wonder if I could run an idea I've had by this list. It seems to me you could get some of the desired effects of lazy evaluation by using continuation passing style in code. For example, take this psuedo-code using CPS to represent an infinite data type. Using non-CPS this wou

Re: Lazy evaluation alternative

2003-01-24 Thread Jerzy Karczmarczuk
Chris Clearwater wrote: It seems to me you could get some of the desired effects of lazy evaluation by using continuation passing style in code. For example, take this psuedo-code using CPS to represent an infinite data type. Using non-CPS this would be something like: ones = 1 : ones using

Lazy evaluation alternative

2003-01-24 Thread Chris Clearwater
I wonder if I could run an idea I've had by this list. It seems to me you could get some of the desired effects of lazy evaluation by using continuation passing style in code. For example, take this psuedo-code using CPS to represent an infinite data type. Using non-CPS this wou

Gratitude message (lazy evaluation etc. document.)

2002-04-11 Thread Jay Cox
On Thu, 11 Apr 2002, Jay Cox wrote: > I still am trying to write a document about strictness and haskell > evaluation for those of us without research degrees ;-) Just to say something quick. There are a few of you that actually responded when I was going to write what I then called "A strictne

Re: Lazy Evaluation

2002-03-04 Thread Jay Cox
On Mon, 4 Mar 2002, Tom Pledger wrote: > Nguyen Phan Dung writes: > : > | mylist :: [Integer] > | mylist = [1..10] > | > | In Hugs, I type mylist to print out all the elements inside. However, > | after printing about 22000 elements, the system crashs & outputs: > | "Garbage collec

Lazy Evaluation

2002-03-03 Thread Tom Pledger
Nguyen Phan Dung writes: : | mylist :: [Integer] | mylist = [1..10] | | In Hugs, I type mylist to print out all the elements inside. However, | after printing about 22000 elements, the system crashs & outputs: | "Garbage collection fails to reclaim sufficient memory" The declarati

Lazy Evaluation

2002-03-03 Thread Nguyen Phan Dung
  Hello,   Sorry for asking such a silly question: Haskell is using lazy evaluation. So, it means we should be able to declare and use a list of billions elements without any trouble. So I declare my list as follow:   mylist :: [Integer] mylist = [1..10]   In Hugs, I type