Possible bug with left section expressions

Hello, 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. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Nikolaos S. Papaspyrou | Tel: +30-210-7723393 National Technical University of Athens | Home: +30-210-7524801 School of Electrical & Computer Engineering | Fax: +30-210-7722519 Software Engineering Laboratory |-=-=-=-=-=-=-=-=-=-=-=-=-=-= 15780 Zografou, Athens, Greece | Happiness is not a state =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-| to arrive at, but a manner Email: nickie@softlab.ntua.gr | of travelling. URL: http://www.softlab.ntua.gr/~nickie/ | --- Margaret Lee Runbeck =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Dear Nikolaos, indeed you are right that this is a bug. I recently introduced it when extending the position information in nhc98 and hat. I just committed a fix to cvs which you can obtain easily with cvs update. Thank you very much for the clear bug report, Olaf Nikolaos S. Papaspyrou wrote:
Hello,
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.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Nikolaos S. Papaspyrou | Tel: +30-210-7723393 National Technical University of Athens | Home: +30-210-7524801 School of Electrical & Computer Engineering | Fax: +30-210-7722519 Software Engineering Laboratory |-=-=-=-=-=-=-=-=-=-=-=-=-=-= 15780 Zografou, Athens, Greece | Happiness is not a state =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-| to arrive at, but a manner Email: nickie@softlab.ntua.gr | of travelling. URL: http://www.softlab.ntua.gr/~nickie/ | --- Margaret Lee Runbeck =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________ Hat mailing list Hat@haskell.org http://www.haskell.org/mailman/listinfo/hat
participants (2)
-
Nikolaos S. Papaspyrou
-
Olaf Chitil