[Haskell-cafe] Re: How to check if two Haskell files are the same?

Svein Ove Aas svein.ove at aas.no
Wed Sep 17 14:08:52 EDT 2008

On Wed, Sep 17, 2008 at 7:04 PM, Mauricio <briqueabraque at yahoo.com> wrote:
>>> I would like to write a Haskell pretty-printer,
>>> using standard libraries for that. How can I
>>> check if the original and the pretty-printed
>>> versions are the same? For instance, is there
>>> a file generated by GHC at the compilation
>>> pipe that is always guaranteed to have the
>>> same MD5 hash when it comes from equivalent
>>> source?
>> Compare .hi files?
> That was my first thought, but can I be sure
> .hi files are going to be exactly the same,
> i.e., isn't there some kind of information
> (timestamps?) that can change without changes
> in the code?
For that matter, the code can change without the .hi file doing so,
eg. if a pragma noinline'd function is altered without changing its
type/strictness - or a function the optimizer decides is just
pointless to try inlining, for all I know.

More information about the Haskell-Cafe mailing list