[Haskell-cafe] Very Small Program

2006-11-02 Thread Bernie Pope
On 02/11/2006, at 9:56 PM, [EMAIL PROTECTED] wrote: G'day all. Quoting Bernie Pope <[EMAIL PROTECTED]>: This is a weird example of a pattern binding, and it is surprising (to me) that the syntax is valid. Maybe. But you wouldn't balk at this: numzeroes xs = sum [ 1 | 0 <- xs ] ...e

Re: [Haskell-cafe] Very Small Program

2006-11-02 Thread Jason Dagit
On 11/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: G'day all. Quoting Bernie Pope <[EMAIL PROTECTED]>: > This is a weird example of a pattern binding, and it is surprising > (to me) that the syntax is valid. Maybe. But you wouldn't balk at this: numzeroes xs = sum [ 1 | 0 <- xs ]

Re: [Haskell-cafe] Very Small Program

2006-11-02 Thread ajb
G'day all. Quoting Bernie Pope <[EMAIL PROTECTED]>: > This is a weird example of a pattern binding, and it is surprising > (to me) that the syntax is valid. Maybe. But you wouldn't balk at this: numzeroes xs = sum [ 1 | 0 <- xs ] ...even if you wouldn't naturally express it that way. Pat

Re: [Haskell-cafe] Very Small Program

2006-11-02 Thread Bulat Ziganshin
Hello Jason, Thursday, November 2, 2006, 8:45:14 AM, you wrote: > let 0 = 1 in 0 > let { 1 + 1 = 3; 3 + 1 = 7 } in 1 + 1 + 1 > Where you get 7. these sippets looks cool :) they may be placed in somewhat like Haskell puzzles -- Best regards, Bulatmailto:[EMAIL PRO

Re: [Haskell-cafe] Very Small Program

2006-11-01 Thread Bernie Pope
On 02/11/2006, at 4:45 PM, Jason Dagit wrote: Hello, I just found it (in ghci and hugs) that this is a valid haskell program: let 0 = 1 in 0 This program evaluates to 0 (to my surprise). This is a weird example of a pattern binding, and it is surprising (to me) that the syntax is valid

[Haskell-cafe] Very Small Program

2006-11-01 Thread Jason Dagit
Hello, I just found it (in ghci and hugs) that this is a valid haskell program: let 0 = 1 in 0 This program evaluates to 0 (to my surprise). I expected something similar to how this works: let { 1 + 1 = 3; 3 + 1 = 7 } in 1 + 1 + 1 Where you get 7. So, if the 0 is not used as an identifier (ie