]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - src/Integration/Simpson.hs
Clean up imports everywhere.
[numerical-analysis.git] / src / Integration / Simpson.hs
index c9ad414b4fa7cc85705af2604d2295524ceeb01e..f0f57f29245db1a7db7bd10bd05a39a87c2347df 100644 (file)
@@ -1,14 +1,17 @@
+{-# LANGUAGE NoImplicitPrelude #-}
 {-# LANGUAGE RebindableSyntax #-}
 
-module Integration.Simpson
+module Integration.Simpson (
+  simpson,
+  simpson_1 )
 where
 
-import Misc (partition)
+import Misc ( partition )
 
-import NumericPrelude hiding (abs)
-import qualified Algebra.RealField as RealField
-import qualified Algebra.ToInteger as ToInteger
-import qualified Algebra.ToRational as ToRational
+import NumericPrelude hiding ( abs )
+import qualified Algebra.RealField as RealField ( C )
+import qualified Algebra.ToInteger as ToInteger ( C )
+import qualified Algebra.ToRational as ToRational ( C )
 
 -- | Use the Simpson's rule to numerically integrate @f@ over the
 --   interval [@a@, @b@].
@@ -45,7 +48,7 @@ simpson_1 :: (RealField.C a, ToRational.C a, RealField.C b)
 simpson_1 f a b =
   coefficient * ((f a) + 4*(f midpoint) + (f b))
   where
-    coefficient = (fromRational' $ toRational (b - a)) / 6
+    coefficient = fromRational' $ (toRational (b - a)) / 6
     midpoint = (a + b) / 2