-import "Prelude"\r
-\r
-data Exp = Exp String\r
-\r
-expToString :: Exp -> String\r
-expToString (Exp s) = s\r
-\r
-instance Additive Exp where\r
- zero = Exp "0"\r
- Exp a + Exp b = Exp ("(" + a + " + " + b + ")")\r
-\r
-instance Ring Exp where\r
- one = Exp "1"\r
- neg (Exp a) = Exp ("(-" + a + ")")\r
- Exp a * Exp b = Exp ("(" + a + " * " + b + ")")\r
- Exp a - Exp b = Exp ("(" + a + " - " + b + ")")\r
- fromInteger x = Exp (show x)\r
- \r
-a = Exp "a"\r
-b = Exp "b"\r
-c = Exp "c"\r
-d = Exp "d"\r
-e = Exp "e"\r
-\r
-main = expToString (a + b*c + d*e)\r
---\r
+import "Prelude"
+
+data Exp = Exp String
+
+expToString :: Exp -> String
+expToString (Exp s) = s
+
+instance Additive Exp where
+ zero = Exp "0"
+ Exp a + Exp b = Exp ("(" + a + " + " + b + ")")
+
+instance Ring Exp where
+ one = Exp "1"
+ neg (Exp a) = Exp ("(-" + a + ")")
+ Exp a * Exp b = Exp ("(" + a + " * " + b + ")")
+ Exp a - Exp b = Exp ("(" + a + " - " + b + ")")
+ fromInteger x = Exp (show x)
+
+a = Exp "a"
+b = Exp "b"
+c = Exp "c"
+d = Exp "d"
+e = Exp "e"
+
+main = expToString (a + b*c + d*e)
+--