[Haskell-cafe] where to put handy functions?

ok ok at cs.otago.ac.nz
Thu Aug 9 22:36:48 EDT 2007


On 10 Aug 2007, at 9:37 am, Stefan O'Rear wrote:
> http://www.haskell.org/haskellwiki/Library_submissions

I'd like to ask if it's possible to add expm1 and log1p to
the Floating class:

class ... Floating a where
     ...
     exp, log, sqrt  :: a -> a
     expm1, lop1p    :: a -> a		-- new, copied from C99
     ...
     expm1 x = exp x - 1			-- but done more accurately
     log1p x = log (1 + x)		-- but done more accurately

However, the Library_submissions page wants an implementation, and
adding this sort of function seems to require getting into the guts
of an implementation.  (Difficult: I am having serious trouble getting
GHC 6.6 to install at all, never mind changing it.)



More information about the Haskell-Cafe mailing list