From 211110c0f3c1b3a6986fe0478a7d1074c131a3ec Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 19 Jun 2018 09:55:55 -0400 Subject: [PATCH] Annotate attemptUnsafeArithmetic explicitly. --- .hlint.yaml | 2 +- src/Data/Scientific/Exts.hs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.hlint.yaml b/.hlint.yaml index 766fee182..92b6c5b1e 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -5,7 +5,7 @@ # Blacklist some functions by default. - functions: - - {name: unsafePerformIO, within: [Data.Scientific.Exts]} # unsafePerformIO has to be explicitly whitelisted + - {name: unsafePerformIO, within: []} # unsafePerformIO has to be explicitly whitelisted - {name: unsafeCoerce, within: []} # unsafeCoerce has to be explicitly whitelisted - {name: head, within: []} - {name: tail, within: []} diff --git a/src/Data/Scientific/Exts.hs b/src/Data/Scientific/Exts.hs index a275002a9..911e58099 100644 --- a/src/Data/Scientific/Exts.hs +++ b/src/Data/Scientific/Exts.hs @@ -106,3 +106,5 @@ parser = signed (choice [hex, oct, bin, dec]) where attemptUnsafeArithmetic :: a -> Either ArithException a attemptUnsafeArithmetic = unsafePerformIO . Exc.try . evaluate {-# NOINLINE attemptUnsafeArithmetic #-} + +{-# ANN attemptUnsafeArithmetic ("HLint: ignore Avoid restricted function" :: String) #-}