Bug in library report
Alastair Reid
alastair@reid-consulting-uk.ltd.uk
23 Jul 2002 17:21:42 +0100
Simon Peyton-Jones <simonpj@microsoft.com> writes:
> Another small but long-standing bug in the Haskell Library
> report: [...]
>
> [...] (How do these bugs last so long?)
None of the compilers actually use the report Prelude/libraries.
When writing the STG-Hugs backend I used the actual report code with
some minor modifications (see note at end). The result was something
that could be diffed against the original or could be executed and
used with a testsuite. This turned up a lot of minor errors in the
report. I think this is the only way we'll catch problems in the
report. (Ideally, the report would take the form of a model Haskell
compiler and library...)
--
Alastair Reid alastair@reid-consulting-uk.ltd.uk
Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/
The main changes needed to the report to make it work with STG-Hugs were:
1) Fill in the ...'s
2) Since Hugs lacks mutually recursive modules, modify the module
headers to read something like:
Prelude.hs:
module Prelude( <whatever Prelude exports> ) where
import PreludeCore
List.hs:
module List( <whatever List exports> ) where
import PreludeCore
Char.hs:
module Char( <whatever Char exports> ) where
import PreludeCore
PreludeCore.hs:
#ifdef __HUGS__
module PreludeCore where
#include "ReportPreludeList.hs"
#include "ReportList.hs"
#include "ReportChar.hs"
#include "ReportNumeric.hs"
#else /* use original text */
module Prelude( .... ) where
import PreludeList
import List
import Char
import Numeric
#endif
... rest of file as in Prelude in Haskell Report