[cvs-nhc98] patch applied (hat): Corrected mergePos in module extra to correct the attached bug.

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


Thu Sep  2 10:51:30 PDT 2004  olaf
  * Corrected mergePos in module extra to correct the attached bug.
  Also made some more progress with hat-source.
  
  ------------------------ Bug report:
  
  I just checked out the latest Hat sources from the CVS.  After
  successful compilation and installation, I think I have a bug
  at hand, in the treatment of left section expressions, e.g. (2+).
  
  A very simple program that generates the bug (let's call the
  file hattest.hs):
  
     generator = ("Hello " ++) . ("world!" ++)
     main        = putStrLn (generator "")
  
  Here's what I get:
  
     formal:~/foo> hmake -hat hattest
     hat-trans  hattest.hs
  
     Fail: mergePos 1:23-1:24 1:14-1:21
  
  As I understand it, (1:23-1:24) is the first "++" and 1:14-1:21
  is the string "Hello ".  The left section is (correctly) converted
  to the application:
  
     (++) "Hello "
  
  but then possitions of the two subexpressions come the wrong way
  and mergePos complains.
  
  I know it can be fixed by writing the expression above instead of
  the left section, but (as this occurs in all Show instances several
  times) I think it is not an acceptable solution.
  
  Am I missing something?  If not, could somebody fix it?
  
  Thank you in advance,
  Nikos.

    M ./src/compiler98/Extra.hs -6 +4
    M ./src/hattools/HatExplore.hs -20 +116


More information about the Cvs-nhc98 mailing list