From c6fe7fbc9f54d4bb582b5dc940d713cfc17510dc Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Sat, 10 Jul 2021 15:36:17 -0400 Subject: [PATCH] Fix monomorphism warning --- src/lib/Witch/Instances.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/Witch/Instances.hs b/src/lib/Witch/Instances.hs index 4541ef6..7fc219e 100644 --- a/src/lib/Witch/Instances.hs +++ b/src/lib/Witch/Instances.hs @@ -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