Possible bug with left section expressions

"Nikolaos S. Papaspyrou" <[email protected]> Thu, 02 Sep 2004 18:10:59 +0300
Newsgroups gmane.comp.lang.haskell.hat
Organization National Technical University of Athens
Message-ID <[email protected]>
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: [email protected]               | of travelling.
URL:   http://www.softlab.ntua.gr/~nickie/  |   --- Margaret Lee Runbeck
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=