Fix monomorphism warning

This commit is contained in:
Taylor Fausak 2021-07-10 15:36:17 -04:00
parent 88bc4efd9d
commit c6fe7fbc9f

View File

@ -911,7 +911,9 @@ instance From.From Rational Double where
-- | Uses `fromRational` as long as there isn't a loss of precision.
instance Fixed.HasResolution a => TryFrom.TryFrom Rational (Fixed.Fixed a) where
tryFrom = Utility.eitherTryFrom $ \s ->
let t = fromRational s :: Fixed.Fixed a
let
t :: Fixed.Fixed a
t = fromRational s
in if toRational t == s
then Right t
else Left Exception.LossOfPrecision