Since Daan upgraded HaskellScript to work with Hugs 1.4, I switched from
version 970719 to the official Januari 1998 release. However, suddenly a lot
of my Dynamic HTML demos failed. Was it due to a case of bit rot, was the
new HaskellScript engine wrong or was perhaps Hugs itself buggy?
Debugging Haskell programs is hard, but debugging HaskellScript programs is
even harder because the whole system crashes when a program error occurs.
Inserting some good old print statements revealed the error. My generated
HTML looked like:
<BUTTON style="BACKGROUND-COLOR: black; HEIGHT: 20pt; WIDTH: 20pt"
type=button 0) LOC = (0,></BUTTON>
where it should look like
<BUTTON style="BACKGROUND-COLOR: black; HEIGHT: 20pt; WIDTH: 20pt"
type=button LOC = (0,0)></BUTTON>
Under version 970719 everything worked fine, so what was going on here? I
suspected that it had something to do with show on pairs, so I tried:
Version 970719
---------------------
Type :? for help
Prelude> show (1,2)
"(1,2)"
Januari 1998
------------------
Type :? for help
Prelude> show (1,2)
"(1, 2)"
And yes indeed, the behaviour of show had changed. Why? Typing :? did not
help! Beauty has its price.
Erik