summaryrefslogtreecommitdiff
path: root/hl.hs
diff options
context:
space:
mode:
Diffstat (limited to 'hl.hs')
-rw-r--r--hl.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/hl.hs b/hl.hs
new file mode 100644
index 0000000..6273b5f
--- /dev/null
+++ b/hl.hs
@@ -0,0 +1,8 @@
+data HL = HL Float Float
+
+instance Eq HL where
+ (==) (HL a1 b1) (HL a2 b2) = a1*b1==a2*b2
+
+instance Show HL where
+ show (HL a b) = (show a) ++ ":" ++ (show b) ++ "->"
+ ++ (show $ sqrt(a**2+b**2))