Sha256: 7a77f966912fc980b23aaa36ea916a16986a4a9fd2ea1b3bc78ae5609c58abd2
Contents?: true
Size: 1.27 KB
Versions: 133
Compression:
Stored size: 1.27 KB
Contents
module ComplexNumbers (Complex, conjugate, abs, real, imaginary, mul, add, sub, div, complex) where import Prelude hiding (div, abs) -- Data definition ------------------------------------------------------------- data Complex a = Dummy deriving(Eq, Show) complex :: (a, a) -> Complex a complex = error "You need to implement this function" -- unary operators ------------------------------------------------------------- conjugate :: Num a => Complex a -> Complex a conjugate = error "You need to implement this function" abs :: Floating a => Complex a -> a abs = error "You need to implement this function" real :: Num a => Complex a -> a real = error "You need to implement this function" imaginary :: Num a => Complex a -> a imaginary = error "You need to implement this function" -- binary operators ------------------------------------------------------------ mul :: Num a => Complex a -> Complex a -> Complex a mul = error "You need to implement this function" add :: Num a => Complex a -> Complex a -> Complex a add = error "You need to implement this function" sub :: Num a => Complex a -> Complex a -> Complex a sub = error "You need to implement this function" div :: Fractional a => Complex a -> Complex a -> Complex a div = error "You need to implement this function"
Version data entries
133 entries across 133 versions & 1 rubygems