[cvs-nhc98] patch applied (hat): Fix a bug in translating (n+k) patterns to code.

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Tue Oct 10 07:07:20 EDT 2006


Fri Sep 14 09:12:57 PDT 2001  malcolm
  * Fix a bug in translating (n+k) patterns to code.
  
    The symptom was that
        foo (n+1) Foo = 1
        foo (n+1) Bar = 2
        foo _ _ = 3
        main = print (foo 1 Bar)
    was offering 3 as result, not 2 as expected.
  
    The cause was that the two equations were being matched in an
    nested if..then..else sequence, with (n>=1) as the condition.
    The correct way is to sequence the matches with FATBAR, so the
    second match is actually attempted.

    M ./src/compiler98/Case.hs -3 +6


More information about the Cvs-nhc98 mailing list