aboutsummaryrefslogtreecommitdiff
path: root/src/complex.hs
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-03-16 10:50:03 +0100
committerCharles <sircharlesaze@gmail.com>2020-03-16 10:50:03 +0100
commitd8751f2cced8f14366533ff0dbbc62fa73ec8665 (patch)
treee216acbfb3d91cfe25870af93626240dbc7afcb3 /src/complex.hs
parentcc2593028c5f380e177adbf8905a43d665ac64cf (diff)
downloadcomputorv2-d8751f2cced8f14366533ff0dbbc62fa73ec8665.tar.gz
computorv2-d8751f2cced8f14366533ff0dbbc62fa73ec8665.tar.bz2
computorv2-d8751f2cced8f14366533ff0dbbc62fa73ec8665.zip
Clean parser for expression containing rational and imaginary
Diffstat (limited to 'src/complex.hs')
-rw-r--r--src/complex.hs17
1 files changed, 0 insertions, 17 deletions
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