Mixture of Integer and Float arithmetic without "fromIntegral "?

Simon Peyton-Jones simonpj@microsoft.com
Thu, 7 Dec 2000 08:12:42 -0800


OK, OK, I've just added -fno-monomorphism-restriction to GHC.

Simon

| -----Original Message-----
| From: Malcolm Wallace [mailto:Malcolm.Wallace@cs.york.ac.uk]
| Sent: 07 December 2000 10:28
| To: haskell-cafe@haskell.org
| Subject: Re: Mixture of Integer and Float arithmetic without
| "fromIntegral"?
| 
| 
| > >   module Defs where
| > > 
| > >   n = 3
| > >   x = 12.3
| > > 
| > >   test = ceiling (x / n)
| > 
| > There are people (including me) who think that the monomorphism
| > restriction rule, which makes the above definitions without type
| > signatures monomorphic and thus defaulted to concrete types, should
| > be removed.
| 
| If you want to experiment with an implementation that do not enforce
| the monomorphism restriction, try nhc98.  It happily infers the types
| 
|    n :: Num a => a
|    x :: Fractional a => a
| 
| for the toplevel definitions shown.  I don't think anyone has ever
| complained about this feature.
| 
| Regards,
|     Malcolm
| 
| _______________________________________________
| Haskell-Cafe mailing list
| Haskell-Cafe@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe
|