Floating-point nitpicking: floor(Inf) and floor(NaN)

2000-02-25 Thread George Russell

floor(Inf) and floor(NaN) do not appear to be defined in Standard Haskell.
(They both come down to "properFraction" which is only defined for Ratio.)
This differs from (for example) the Standard ML Basis Library, where it
is specified that floor(Int) should raise Overflow and floor(NaN) should
raise Domain.  Hence Hugs and GHC do different things.

Hugs returns floor(Inf) = 0 and floor(NaN) = 0
GHC returns floor(Inf) = very very large integer and floor(NaN) = even larger
integer.  (This is because the GHC implementation of properFraction simply
ignores the case of Inf/NaN and treats the artificially high exponent encoded
in those floating-point numbers as if it were a real one.)

My own opinion is that Standard ML is right here and that floor(x) should
raise an exception (In Haskell terms, fail) when x does not correspond to a 
real number.



Re: Importing instances without pangling Make

2000-02-25 Thread Jon Fairbairn

 At the time of writing, I am waiting for yet another long Haskell re-make of
 lots of modules to complete.  The frustrating thing is, that at least 90% of 
 these
 remakes are actually completely unnecessary.

I'm afraid I've not gone through your detailed suggestions, but in the
short term, would a crude hack that I used to use with Algol68C help?

For that I forced the compiler to output interface files to somewhere
temporary and then used diff on them to see if there were any
substantive differences.  If there were none, (and compilations
referring to them would therefore behave no differently) I would not
copy the temporary version into the real place.  All in a wrapper
script around the compiler, of course.

  Jón


-- 
Jón Fairbairn [EMAIL PROTECTED]
18 Kimberley Road[EMAIL PROTECTED]
Cambridge CB4 1HH+44 1223 570179 (after 14:00 only, please!)





Re: Importing instances without pangling Make

2000-02-25 Thread Malcolm Wallace

 Suppose that B had imported C only
 to export it again (either by listing it in the export list, or not
 having any export list at all).

Wrong.  If B imports C and has no export list, nothing from C is
re-exported, only definitions from B itself, with the single exception
of C's instance decls.

Regards,
Malcolm




Re: Importing instances without pangling Make

2000-02-25 Thread George Russell

George Russell wrote:
 This scheme is not the cleverest that could be devised.  For example it is
 still necessary to recompile whole chains of modules if you add an import
 declaration.  (Not to a system library, imports from those are counted as
 "stable" in GHCs and my system.)  To fix this you would need to keep more
 information in the .hi file. 
Actually we can catch most of these cases too.  Alter algorithm A so that
if we have no changes to instances declarations in this file, the version
numbers in directly imported modules are all the same, and the only change
is that we import some modules we didn't import before, then only bump the
version number if the import leads to new modules being imported which contain
instance declarations.  I think you can compute this at very close to zero
cost at the start of compilation, when you are doing the imports.



Re: Importing instances without pangling Make

2000-02-25 Thread George Russell

Malcolm Wallace wrote:
 Wrong.  If B imports C and has no export list, nothing from C is
 re-exported, only definitions from B itself, with the single exception
 of C's instance decls.
OK, but this has no influence at all on my suggestions except to make
them work slightly better.



Re: Importing instances without pangling Make

2000-02-25 Thread George Russell

Jon Fairbairn wrote:
 I'm afraid I've not gone through your detailed suggestions, but in the
 short term, would a crude hack that I used to use with Algol68C help?
No, fraid not.  GHC already does this hack anyway.  Algol68C didn't have
interface declarations.  Still, nice to find someone else who remembers it.



RE: Importing instances without pangling Make

2000-02-25 Thread Sigbjorn Finne


Seems like you're not using -recomp.

--sigbjorn

 -Original Message-
 From: George Russell [mailto:[EMAIL PROTECTED]]
 Sent: Friday, February 25, 2000 8:53 AM
 To: [EMAIL PROTECTED]
 Subject: Importing instances without pangling Make
 
 




Re: Importing instances without pangling Make

2000-02-25 Thread George Russell

Sigbjorn Finne wrote:
 
 Seems like you're not using -recomp.
No I'm not.  What about documenting it somewhere?



Re: Importing instances without pangling Make

2000-02-25 Thread Sven Panne

Sven Panne wrote:
 George Russell wrote:
  [...] Supposing you now make a change to C.  For example, suppose
  you add a line
 pangle = "pangle"
  to the end of C, and add "pangle" to the list of exports from C.
  Then you recompile C.  You will find that C.hi now has a new version
  number "2".
 
 Strange, this is not the case with my version of GHC (from the CVS
 repository two days ago).

Ooops, too quick!  :-} I didn't read closely enough and didn't add
`pangle' to the export list...

Anyway, in my experience -recomp plus explicit import lists are a
big gain in recompilation time.

Cheers,
   Sven
-- 
Sven PanneTel.: +49/89/2178-2235
LMU, Institut fuer Informatik FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen  Oettingenstr. 67
mailto:[EMAIL PROTECTED]D-80538 Muenchen
http://www.informatik.uni-muenchen.de/~Sven.Panne



Re: Importing instances without pangling Make

2000-02-25 Thread George Russell

George Russell wrote:
 
 Sigbjorn Finne wrote:
 
  Seems like you're not using -recomp.
 No I'm not.  What about documenting it somewhere?
I take that back.  I AM using it in the big program I mentioned, but I still
get huge swathes of unnecessary compilations.  Maybe it needs to be still cleverer.



RE: Importing instances without pangling Make

2000-02-25 Thread Sigbjorn Finne


George Russell [EMAIL PROTECTED] writes:
 
 Sigbjorn Finne wrote:
  
  Seems like you're not using -recomp.
 No I'm not.  What about documenting it somewhere?
 

I think that's a fine suggestion which GHC HQ will probably
do something about (Section 3.7.4 doesn't actually mention
it by name.)

Re: recomp checker, Patrick Sansom wrote up a paper about
it (see http://www.dcs.gla.ac.uk/~sansom/ ) - Simon has
improved and modified the story a bit since then, but the
underlying idea is still very much the same.

--sigbjorn



No Subject

2000-02-25 Thread alavaro ubiria



My Name is William Uruguay Montevideo South 
America

Y have a lot of manuals and program about Hakell 
and more 

Y like verimach y have Hugs and few manuals 
printed but

20 and more time y have dowload ghc but 
dont work it
It is posibilite to have with a cdroom ym 
pay for these veri good
program my email is [EMAIL PROTECTED]

My adrres is William Artifoni
Alto Peru 1928 (Malvin)  Ap 1
Montevideo
Uruguay
ok by by