From 5bdaa1e4ffe40add10f000ee993e6b500c419a37 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Sat, 9 Aug 2014 10:58:03 +0800 Subject: add files from home for previous chapters and sandboxes --- hl.hs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 hl.hs (limited to 'hl.hs') 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)) -- cgit v1.2.3-70-g09d2