Last active
August 11, 2017 10:54
-
-
Save rahult/dc4be01d98a1026f4c5e94e8f2c84cc4 to your computer and use it in GitHub Desktop.
Revisions
-
rahult renamed this gist
Aug 11, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rahult created this gist
Aug 11, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ module Main where import Prelude newtype Complex = Complex { real :: Number, imaginary :: Number } instance showComplex :: Show Complex where show (Complex { real: r, imaginary: i }) = show r <> " + " <> show i <> "i" instance eqComplex :: Eq Complex where (==) (Complex { real: a1, imaginary: b1 }) (Complex { real: a2, imaginary: b2 }) = a1 == a2 && b1 == b2