Compiler Versions
Simon Marlow
simonmar at microsoft.com
Tue Apr 13 18:26:35 EDT 2004
> Simon Marlow wrote (snipped):
> > I agree it's not worth arguing, it's more important to
> decide whether we can implement Read Version.
>
> Why is the Read instance for Version so important? I don't really see
> one using it much. The only occasion I can imagine when you
> would actually
> want to create a Version value for GHC is when you send a new
> release out the door.
>
> I don't really the instance of Ord being that important
> either. What one
> wants to know is whether
> (1) version X was released later than some given date;
> (2) version X is lexicographically subsequent to [sequence of
> integers]
> (so GHC 6.02.1 comes after GHC 4.08.1);
> (3) version X is a subversion of [sequence of integers], as
> 6.2.1 is a subversion of 6.2;
> (4) version X has a tag attached meaning "DANGER. Do not use
> unless your
> name is Simon".
I see - I assumed you were planning to have Ord and Read instances for
Version and compare versions by doing
if ghc_version => read "6.2" then ...
but you'd do it like this:
if branch ghc_version >= [6,2] then ...
which is fine. In fact, I think I like yours better :-)
I'm not convinced of the need to have a date attached to all versions,
though. Under what circumstances do you imagine needing (1) above,
where (2) won't do?
Cheers,
Simon
More information about the Libraries
mailing list