shithub: MicroHs

Download patch

ref: 4abfb3cc6a361b5cd547329afe8831409d9e0f67
parent: 38ee67a83d406d07e9a1aa0ff31e1800030380df
author: Lennart Augustsson <lennart@augustsson.net>
date: Wed Nov 8 10:05:05 EST 2023

Adapt to parser bug

--- a/lib/Data/Complex.hs
+++ b/lib/Data/Complex.hs
@@ -3,7 +3,13 @@
 
 infix 6 :+
 
-data Complex a = (:+) a a    -- XXX should be strict
+data Complex a = a :+ a    -- XXX should be strict
+
+instance forall a . Eq a => Eq (Complex a) where
+  (:+) x y == (:+) x' y'  =  x == x' && y == y'   -- parser bug
+
+instance forall a . Show a => Show (Complex a) where
+  show (x :+ y) = show x ++ " :+ " ++ show y
 
 realPart :: forall a . Complex a -> a
 realPart (x :+ _) =  x
--