From 0e0028bca98c4bca37f95b08db82db610a916f06 Mon Sep 17 00:00:00 2001 From: Yoo Chung Date: Thu, 10 Oct 2024 17:43:14 -0400 Subject: [PATCH] Enable `Use fewer imports` hint for HLint. (#488) * Use fewer imports. --- .hlint.yaml | 1 - proto-lens-tests/tests/raw_fields_test.hs | 3 +-- proto-lens/src/Data/ProtoLens/Encoding/Bytes.hs | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.hlint.yaml b/.hlint.yaml index 13dabb47..72f82546 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -20,7 +20,6 @@ - ignore: {name: "Use ?~"} # 5 hints - ignore: {name: "Use camelCase"} # 3 hints - ignore: {name: "Use concatMap"} # 1 hint -- ignore: {name: "Use fewer imports"} # 2 hints - ignore: {name: "Use fmap"} # 10 hints - ignore: {name: "Use lambda-case"} # 3 hints - ignore: {name: "Use maybe"} # 1 hint diff --git a/proto-lens-tests/tests/raw_fields_test.hs b/proto-lens-tests/tests/raw_fields_test.hs index cef29cef..9be2ee5c 100644 --- a/proto-lens-tests/tests/raw_fields_test.hs +++ b/proto-lens-tests/tests/raw_fields_test.hs @@ -13,7 +13,7 @@ module Main where import Control.Arrow (second) import Proto.RawFields import Proto.RawFields_Fields -import Data.ByteString.Builder (word8) +import Data.ByteString.Builder (Builder, byteString, word8) import Data.ProtoLens import Lens.Family2 (Lens', (&), (.~)) import Data.Int (Int32, Int64) @@ -24,7 +24,6 @@ import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.Lazy as LT import Data.Text.Encoding (encodeUtf8) -import Data.ByteString.Builder (Builder, byteString) import Data.ProtoLens.TestUtil diff --git a/proto-lens/src/Data/ProtoLens/Encoding/Bytes.hs b/proto-lens/src/Data/ProtoLens/Encoding/Bytes.hs index 7888f8bc..1449fa81 100644 --- a/proto-lens/src/Data/ProtoLens/Encoding/Bytes.hs +++ b/proto-lens/src/Data/ProtoLens/Encoding/Bytes.hs @@ -62,14 +62,14 @@ import Data.Semigroup ((<>)) import qualified Data.Vector.Generic as V import Data.Word (Word8, Word32, Word64) import Foreign.Marshal (malloc, free) -import Foreign.Storable (peek) import System.IO (Handle, hGetBuf) #if MIN_VERSION_base(4,11,0) import qualified GHC.Float as Float +import Foreign.Storable (peek) #else import Foreign.Ptr (castPtr) import Foreign.Marshal.Alloc (alloca) -import Foreign.Storable (Storable, poke) +import Foreign.Storable (Storable, peek, poke) import System.IO.Unsafe (unsafePerformIO) #endif