RE: Literate scripts not handled correctly

The definitions of foo and bar are not at the same indentation level, so they are being rejected by the layout rule. At least, hugs and nhc98 accept it if you indent bar by two spaces, ghc still complains:
ghc -c lit.lhs lit.lhs:9: parse error on input `_'
Then I think hugs and nhc98 are wrong. The report states that the unliterate version of the file is recovered by "taking only those lines beginning with '>', and removing the first character of those lines", which would leave the lines indented by a single space, not two. Cheers, Simon

Then I think hugs and nhc98 are wrong. The report states that the unliterate version of the file is recovered by "taking only those lines beginning with '>', and removing the first character of those lines", which would leave the lines indented by a single space, not two.
This would appear to be an un-remarked change to the Report since version 1.2. That version states that "program lines have the leading '>' replaced by a leading space, to preserve tab alignments". Version 1.3 removed this specification, and the changed specification only appeared in Haskell'98. I would like to submit it as a bug in the Report - the older specification, as implemented by Hugs and nhc98 makes more sense in conjunction with the layout rule. Regards, Malcolm
participants (2)
-
Malcolm Wallace
-
Simon Marlow