summaryrefslogtreecommitdiff
path: root/libraries/base/Data/Complex.hs
diff options
context:
space:
mode:
authorross <unknown>2003-02-06 10:41:10 +0000
committerross <unknown>2003-02-06 10:41:10 +0000
commit36f5c2d6a7c25a096ebcdeb612744ea34f09d851 (patch)
tree49083bab4be22309ae681e8f77c491000d91cdd5 /libraries/base/Data/Complex.hs
parent7c070f263b1921acd07f3e12b3c7c4c88a8be2b2 (diff)
downloadhaskell-36f5c2d6a7c25a096ebcdeb612744ea34f09d851.tar.gz
[project @ 2003-02-06 10:41:10 by ross]
Hugs-only: special definitions of fromInt & fromDouble.
Diffstat (limited to 'libraries/base/Data/Complex.hs')
-rw-r--r--libraries/base/Data/Complex.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/libraries/base/Data/Complex.hs b/libraries/base/Data/Complex.hs
index c9f8334159..3b15691c19 100644
--- a/libraries/base/Data/Complex.hs
+++ b/libraries/base/Data/Complex.hs
@@ -43,6 +43,10 @@ import Prelude
import Data.Dynamic
#endif
+#ifdef __HUGS__
+import Hugs.Prelude(Num(fromInt), Fractional(fromDouble))
+#endif
+
infix 6 :+
-- -----------------------------------------------------------------------------
@@ -106,6 +110,9 @@ instance (RealFloat a) => Num (Complex a) where
signum 0 = 0
signum z@(x:+y) = x/r :+ y/r where r = magnitude z
fromInteger n = fromInteger n :+ 0
+#ifdef __HUGS__
+ fromInt n = fromInt n :+ 0
+#endif
instance (RealFloat a) => Fractional (Complex a) where
{-# SPECIALISE instance Fractional (Complex Float) #-}
@@ -117,6 +124,9 @@ instance (RealFloat a) => Fractional (Complex a) where
d = x'*x'' + y'*y''
fromRational a = fromRational a :+ 0
+#ifdef __HUGS__
+ fromDouble a = fromDouble a :+ 0
+#endif
instance (RealFloat a) => Floating (Complex a) where
{-# SPECIALISE instance Floating (Complex Float) #-}