File: Complex.hs

package info (click to toggle)
haskell98-report 20080907-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 2,144 kB
  • sloc: haskell: 4,078; makefile: 322
file content (21 lines) | stat: -rw-r--r-- 889 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module  Complex ( 
    Complex((:+)), realPart, imagPart, conjugate, 
    mkPolar, cis, polar, magnitude, phase ) where

infix  6  :+

data  (RealFloat a)     => Complex a = !a :+ !a

realPart, imagPart      :: (RealFloat a) => Complex a -> a
conjugate	        :: (RealFloat a) => Complex a -> Complex a
mkPolar		        :: (RealFloat a) => a -> a -> Complex a
cis		        :: (RealFloat a) => a -> Complex a
polar		        :: (RealFloat a) => Complex a -> (a,a)
magnitude, phase        :: (RealFloat a) => Complex a -> a

instance  (RealFloat a) => Eq         (Complex a)  where ...
instance  (RealFloat a) => Read       (Complex a)  where ...
instance  (RealFloat a) => Show       (Complex a)  where ...
instance  (RealFloat a) => Num        (Complex a)  where ...
instance  (RealFloat a) => Fractional (Complex a)  where ...
instance  (RealFloat a) => Floating   (Complex a)  where ...