diff --git a/src/ShellCheck/Formatter/JSON1.hs b/src/ShellCheck/Formatter/JSON1.hs index 2169bf666..b4dbe352d 100644 --- a/src/ShellCheck/Formatter/JSON1.hs +++ b/src/ShellCheck/Formatter/JSON1.hs @@ -27,9 +27,9 @@ import Control.DeepSeq import Data.Aeson import Data.IORef import Data.Monoid -import GHC.Exts import System.IO import qualified Data.ByteString.Lazy.Char8 as BL +import qualified Data.List.NonEmpty as NE format :: IO Formatter format = do @@ -114,10 +114,10 @@ outputError file msg = hPutStrLn stderr $ file ++ ": " ++ msg collectResult ref cr sys = mapM_ f groups where comments = crComments cr - groups = groupWith sourceFile comments - f :: [PositionedComment] -> IO () + groups = NE.groupWith sourceFile comments + f :: NE.NonEmpty PositionedComment -> IO () f group = do - let filename = sourceFile (head group) + let filename = sourceFile (NE.head group) result <- siReadFile sys (Just True) filename let contents = either (const "") id result let comments' = makeNonVirtual comments contents