Trying to encode complex numbers in haskell without using alibrary, but confused on how to fill these out
Help would be appreciated
data Complex = C Double Double deriving (Show, Eq)
instance Ord Complex where
compare c1 c2 = undefined
instance Num Complex where
data Complex a
(+) = undefined
(-) = undefined
(*) = undefined
abs = undefined
signum _ = error “no signum for complex numbers!”
fromInteger = undefined
negate = undefined
Solution