From 6db8b645fa7c9e80bacf1a49be8b2172784ca960 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Wed, 24 Apr 2024 07:25:56 -0400 Subject: [PATCH] Use qualified Data.List imports This has the benefit of avoiding `-Wunused-imports` warnings on GHC 9.10 due to `foldl'` being added to the `Prelude`. --- include/internal_kahn.h | 4 ++-- src/Numeric/AD/Internal/Kahn.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/internal_kahn.h b/include/internal_kahn.h index 2875a91..6204cd0 100644 --- a/include/internal_kahn.h +++ b/include/internal_kahn.h @@ -53,7 +53,7 @@ MODULE import Control.Monad.ST import Control.Monad hiding (mapM) import Control.Monad.Trans.State -import Data.List (foldl') +import qualified Data.List as List (foldl') import Data.Array.ST import Data.Array.IArray import qualified Data.Array as A @@ -235,7 +235,7 @@ partials tape = [ let v = sensitivities ! ix in seq v (ident, v) | (ix, Var _ id backPropagate vmap ss return ss - sbounds ((a,_):as) = foldl' (\(lo,hi) (b,_) -> let lo' = min lo b; hi' = max hi b in lo' `seq` hi' `seq` (lo', hi')) (a,a) as + sbounds ((a,_):as) = List.foldl' (\(lo,hi) (b,_) -> let lo' = min lo b; hi' = max hi b in lo' `seq` hi' `seq` (lo', hi')) (a,a) as sbounds _ = undefined -- the graph can't be empty, it contains the output node! successors :: Tape Int -> [Int] diff --git a/src/Numeric/AD/Internal/Kahn.hs b/src/Numeric/AD/Internal/Kahn.hs index 8628869..b090cd1 100644 --- a/src/Numeric/AD/Internal/Kahn.hs +++ b/src/Numeric/AD/Internal/Kahn.hs @@ -51,7 +51,7 @@ module Numeric.AD.Internal.Kahn import Control.Monad.ST import Control.Monad hiding (mapM) import Control.Monad.Trans.State -import Data.List (foldl') +import qualified Data.List as List (foldl') import Data.Array.ST import Data.Array import Data.IntMap (IntMap, fromListWith, findWithDefault) @@ -223,7 +223,7 @@ partials tape = [ let v = sensitivities ! ix in seq v (ident, v) | (ix, Var _ id backPropagate vmap ss return ss - sbounds ((a,_):as) = foldl' (\(lo,hi) (b,_) -> let lo' = min lo b; hi' = max hi b in lo' `seq` hi' `seq` (lo', hi')) (a,a) as + sbounds ((a,_):as) = List.foldl' (\(lo,hi) (b,_) -> let lo' = min lo b; hi' = max hi b in lo' `seq` hi' `seq` (lo', hi')) (a,a) as sbounds _ = undefined -- the graph can't be empty, it contains the output node! successors :: Tape a Int -> [Int]