pattern matching overlap

2000-12-15 Thread Dean Herington
The program shown below elicits a complaint about pattern overlap for doMem1 (but not doMem2). I don't expect any complaint. (Hugs accepts both.) Dean Herington [EMAIL PROTECTED] swift(125)% cat GHCtest1.lhs module Main where type Label = Int data Exp = CONST Integer | LREF

Re: C stack

2000-12-15 Thread Jan Kort
Simon Marlow wrote: I don't forsee any problems with the C stack - the stack pointer stays static during execution of Haskell code, and only moves when we do a C call or return to the RTS. But how do I get the address of the bottom of the stack ? It seems I can define a C main so I can get

Finding primes using a primes map with Haskell and Hugs98

2000-12-15 Thread Shlomi Fish
Hi! As some of you may know, a Haskell program that prints all the primes can be as short as the following: primes = sieve [2.. ] where sieve (p:x) = p : sieve [ n | n - x, n `mod` p 0 ] Now, this program roughly corresponds to the following perl program: ## SNIP SNIP #