Problem with 'nested' pattern matching

2002-01-31 Thread carlos . scheidegger
Hello. I'm having some trouble trying to understand exactly what's behind the rule for pattern-matching with data constructors. The code I'm having trouble with is similar to this: f (C p1 p2 (C2 p3 p4)) = ... f _ = False What happens is if f is called with (C p1 p2 (NOT_C2 ...)), I get a

RE: n+k patterns

2002-01-30 Thread carlos . scheidegger
On 30 Jan 2002, at 12:01, [EMAIL PROTECTED] wrote: Yet for floats there may not be such an x (y = positive zero), or there may be more than one (y=2^n with n chosen so that 2^n+1 is not exactly representable but 2^n-1 is, then x could be 2^n or 2^n-1). Well, I am just a newbie in Haskell,

GHC doesn't compile Happy example

2001-10-01 Thread carlos . scheidegger
Hello all. I'm trying to use GHC to compile the example parser in Happy, but with no success. I'm using GHC 5.02 for W2K, and I'm not quite sure what to do to make it work. I successfully compiled some small test cases, to see if I had installation problems, and they compiled just

WinHugs crashes reversing infinite lists

2001-10-01 Thread carlos . scheidegger
Hello all. I think I found a bug on Hugs for Windows 32 (both on the GUI version and the console). If you try to reverse an infinite list, for example: reverse (repeat 0) reverse [1..] This will make Hugs segfault. Of course, reversing an infinite list is not something you should