Minor problem with "Floating" class in Prelude
The 'Floating' class in the standard prelude reads:
class (Fractional a) => Floating a where pi :: a exp, log, sqrt :: a -> a (**), logBase :: a -> a -> a sin, cos, tan :: a -> a asin, acos, atan :: a -> a sinh, cosh, tanh :: a -> a asinh, acosh, atanh :: a -> a
-- Minimal complete definition: -- pi, exp, log, sin, cos, sinh, cosh -- asinh, acosh, atanh x ** y = exp (log x * y) logBase x y = log y / log x sqrt x = x ** 0.5 tan x = sin x / cos x tanh x = sinh x / cosh x
Please add asin, acos, and atan to the minimal complete definition list. [Incidentally, I find these minimal definition lists very useful; I'd love to see them become more than just comments.] --Dylan
On Fri, Aug 17, 2001 at 11:17:17PM -0400, Dylan Thurston wrote:
[Incidentally, I find these minimal definition lists very useful; I'd love to see them become more than just comments.]
Here's one cheap proposal: Add a "MINDEFINITION" pragma which takes a boolean expression whose variables are the class functions. Since it's a pragma, this should only produce warnings if violated. --Dylan
participants (1)
-
Dylan Thurston