[Haskell-cafe] Bug in Hugs, Haskell behavior question

Fritz Ruehr fruehr at willamette.edu
Fri Apr 4 23:15:48 EDT 2008


Derek: yes, I caught this in the language description not long after  
hitting "send": I had forgotten about that.

But then I anticipated the behavior Ryan shows below, where using a  
variable that's part of a "strange" pattern will cause an error (I  
didn't want to check it while driving home--cell phone user/drivers  
are bad enough!--so thanks, Ryan, for verifying :) ).

In any case, opinions about the behavior aside, there is a Hugs  
internal error here, so I hope that much is useful.

The strange cases make for interesting academic discussions, at least.

   --  Fritz

On Fri 4 Apr 08, at 6:49 pm, Derek Elkins wrote:

> Top-level bindings are irrefutable, so 2 = 3 is fine, if vacuous.

On Fri 4 Apr 08, at 6:53 pm, Ryan Ingram wrote:

> On 4/4/08, Fritz Ruehr <fruehr at willamette.edu> wrote:
>> In fact, even this goes through without a hitch!
>>
>>        2 = 3
>
> This is hilarious.
>
> Maybe bindings that don't actually bind anything should be an error?
> Or at least a warning?
>
> In ghci:
>
> Prelude> let 2 = 3
> -- no problem
> Prelude> let (2,x) = (3,4)
> -- no problem
> Prelude> x
> *** Exception: <interactive>:1:4-16: Irrefutable pattern match failed
> for pattern (2,x)
>
>   -- ryan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/hugs-bugs/attachments/20080404/8fc1ca82/attachment.htm


More information about the Hugs-Bugs mailing list