From: Michael Orlitzky Date: Fri, 7 Dec 2018 15:45:06 +0000 (-0500) Subject: src/ODE/IVP.hs: fix monomorphism restriction warning. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=e1bf90ef57aaa37620e001d04cabec0ea2e8ddbf;p=numerical-analysis.git src/ODE/IVP.hs: fix monomorphism restriction warning. --- diff --git a/src/ODE/IVP.hs b/src/ODE/IVP.hs index 6f798f4..5bffe08 100644 --- a/src/ODE/IVP.hs +++ b/src/ODE/IVP.hs @@ -34,7 +34,7 @@ import qualified Algebra.RealField as RealField ( C ) -- >>> eulers_method1 x0 y0 f h -- 2.0 -- -eulers_method1 :: (Field.C a, ToRational.C a, Field.C b) +eulers_method1 :: forall a b. (Field.C a, ToRational.C a, Field.C b) => a -- ^ x0, the initial point -> b -- ^ y0, the initial value at x0 -> (a -> b -> b) -- ^ The function f(x,y) @@ -43,7 +43,7 @@ eulers_method1 :: (Field.C a, ToRational.C a, Field.C b) eulers_method1 x0 y0 f h = y0 + h'*y' where - h' = fromRational'$ toRational h + h' = fromRational'$ toRational h :: b y' = (f x0 y0)