Re: Ground Up

2002-03-03 Thread Max Kirillov

You're right with this (and the rest too). In did not
pretend to play an expert. I just shared my impression.

Anyway, I think there are many reasons to learn functional
programming first, and then haskell as an implementation.

Max.

On Fri, Mar 01, 2002 at 12:47:34AM -0800, Simon Peyton-Jones wrote:
 c) I have a very high opinion of Caml and Scheme, and their
 impls, but I think you are being a bit unfair on Haskell here.
 Caml has only one impl, and Scheme has many 
 incompatible variants (eg PLT Scheme), so in practice you
 have to stick to one impl unless you use a the R3RS subset.  
 I don't think any of them are more stable than any particular 
 one of the Haskell impls.

 Simon
 
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



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 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



Would you please help
me with this problem?

Thank you very much,

Phan Dung.








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 declaration of mylist is a pattern binding, not a function binding
- see section 4.4.3 of the Haskell 98 report.

What that means in this particular case is that the system saves the
result in case you want to use it again, rather than freeing the part
of the list it's already printed.

Try typing [1..10] at the Hugs prompt instead.

Regards,
Tom
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe