Commits

Thijs Alkemade committed 008923d

Fix some hlint warnings.

Comments (0)

Files changed (3)

 data Value a (b :: UnitMap) c = Value a
 
 instance (Convertable a b) => Show b where
-	show _ = (showunit False one)
+	show _ = showunit False one
 		where
 			one :: (Fractional f) => Value f a b
 			one = one
 
 instance (Fractional f, Show f, Convertable a b, Show b) => Show (Value f a b) where
-	show u = (show $ val u) ++ " " ++ (showunit False u)
+	show u = show (val u) ++ " " ++ showunit False u
 
 -- We currently have 5 operators on values-with-units: division, multiplication, addition, substraction and lifting a rational into a given unit
 
 a .-. b = mkVal (val a - val (coerce b a))
 
 (.$.) :: (Convertable a b, Fractional f) => f -> Value f a b -> Value f a b
-d .$. u = mkVal (d * (val u))
+d .$. u = mkVal (d * val u)
 
 mkVal :: (Fractional f) => f -> Value f a b
 mkVal = Value

src/UnitTyped/NoPrelude.hs

 (.) = (.$.)
 
 instance (Fractional f, Convertable a b, t ~ Value f a b) => (Prelude.Num (Value f a b -> t)) where
-	fromInteger i x = (Prelude.fromInteger i) . x
+	fromInteger i x = Prelude.fromInteger i . x
 	(+) = error "This should not happen"
 	(*) = error "This should not happen"
 	abs = error "This should not happen"
 	signum = error "This should not happen"
 
 instance (Fractional f, Convertable a b, t ~ Value f a b) => (Fractional (Value f a b -> t)) where
-	fromRational r x = (Prelude.fromRational r) . x
+	fromRational r x = Prelude.fromRational r . x
 
 instance (Fractional f, Convertable a (m b), c ~ (Value f a b -> Value f a (m b))) => (Prelude.Num ((Value f a b -> Value f a (m b)) -> c)) where
-	fromInteger i x y = (Prelude.fromInteger i) . (x y)
+	fromInteger i x y = Prelude.fromInteger i . x y
 	(+) = error "This should not happen"
 	(*) = error "This should not happen"
 	abs = error "This should not happen"
 	signum = error "This should not happen"
 
 instance (Fractional f, Convertable a (m b), c ~ (Value f a b -> Value f a (m b))) => (Fractional ((Value f a b -> Value f a (m b)) -> c)) where
-	fromRational i x y = (Prelude.fromRational i) . (x y)
+	fromRational i x y = Prelude.fromRational i . x y
 
 wrap1 :: (Floating f, Convertable CountUnit b) => (f -> f) -> Value f CountUnit b -> Value f CountUnit Count
-wrap1 op v = (op $ val $ coerce v rad) . one
+wrap1 op v = op (val $ coerce v rad) . one
 
 sin, cos, tan :: (Floating f, Convertable CountUnit b) => Value f CountUnit b -> Value f CountUnit Count
 sin = wrap1 Prelude.sin
 tan = wrap1 Prelude.tan
 
 wrap2 :: (Floating f) => (f -> f) -> Value f CountUnit Count -> Value f CountUnit Radian
-wrap2 op v = (op $ val v) . one
+wrap2 op v = op (val v) . one
 
 asin, acos, atan :: (Floating f) => Value f CountUnit Count -> Value f CountUnit Radian
 asin = wrap2 Prelude.asin

src/UnitTyped/SI/Meta.hs

 	               sub = one
 	               self :: (Fractional f) => Value f a (m b)
 	               self = one
-	           in (metafactor self) * (factor sub)
+	           in metafactor self * factor sub
 	showunit b v = let
 			 		   u :: (Fractional f) => Value f a b
 					   u = one
-				   in metashow v ++ (showunit False u) 
+				   in metashow v ++ showunit False u
 
 --