Trying Encode Complex Numbers Haskell Without Using Library Confused Fill Help Would Appre Q37047608

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


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.