From d8751f2cced8f14366533ff0dbbc62fa73ec8665 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 16 Mar 2020 10:50:03 +0100 Subject: Clean parser for expression containing rational and imaginary --- src/complex.hs | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/complex.hs (limited to 'src/complex.hs') diff --git a/src/complex.hs b/src/complex.hs deleted file mode 100644 index 220fe1f..0000000 --- a/src/complex.hs +++ /dev/null @@ -1,17 +0,0 @@ -module Complex where - -type Imaginary = Float - -data Complex = Complex Float Imaginary - --- instance Num Complex where --- (Complex r1 i1) + (Complex r2 i2) = Complex (r1 + r2) (i1 + i2) --- (Complex r1 i1) * (Complex r2 i2) = undefined --- negate (Complex r1 i1) = undefined --- abs (Complex r1 i1) = undefined --- signum (Complex r1 i1) = undefined - -- fromInteger r = Complex r 0 - -instance Show Complex where - show (Complex r i) = show r ++ showI ++ "i" - where showI = if i < 0 then " - " ++ show (-i) else " + " ++ show i -- cgit