Portability  portable 

Stability  provisional 
Maintainer  libraries@haskell.org 
A version of Data.Complex, using the same type, but with less constrained operations. In particular this version permits Gaussian integers.
 data Complex a = !a :+ !a
 realPart :: Complex a > a
 imagPart :: Complex a > a
 mkPolar :: Floating a => a > a > Complex a
 cis :: Floating a => a > Complex a
 polar :: RealFloat a => Complex a > (a, a)
 magnitude :: RealFloat a => Complex a > a
 phase :: RealFloat a => Complex a > a
 conjugate :: AbelianGroup a => Complex a > Complex a
Rectangular form
data Complex a
Complex numbers are an algebraic type.
For a complex number z
,
is a number with the magnitude of abs
zz
,
but oriented in the positive real direction, whereas
has the phase of signum
zz
, but unit magnitude.
!a :+ !a  forms a complex number from its real and imaginary rectangular components. 
Typeable1 Complex  
Eq a => Eq (Complex a)  
RealFloat a => Floating (Complex a)  
RealFloat a => Fractional (Complex a)  
Data a => Data (Complex a)  
RealFloat a => Num (Complex a)  
Read a => Read (Complex a)  
Show a => Show (Complex a)  
RealFloat a => Field (Complex a) 

Integral a => EuclideanDomain (Complex a)  Gaussian integers:
if 
Ring a => Ring (Complex a)  
AbelianGroup a => AbelianGroup (Complex a)  
RealFloat a => Floating (Complex a)  
RealFloat a => Fractional (Complex a)  
RealFloat a => Num (Complex a) 
Polar form
mkPolar :: Floating a => a > a > Complex aSource
Form a complex number from polar components of magnitude and phase.
magnitude :: RealFloat a => Complex a > aSource
The nonnegative magnitude of a complex number.
RealFloat
is used to do scaling to reduce the incidence of overflow.
Conjugate
conjugate :: AbelianGroup a => Complex a > Complex aSource
The conjugate of a complex number.