From 3594dd9855efbcbfd8c1e62037e8c8a7ece93411 Mon Sep 17 00:00:00 2001 From: Mikolaj Konarski Date: Mon, 8 Dec 2025 23:41:47 +0100 Subject: Add INLINEABLE to ixxToLinear ahead of generalization, to benchmark No horde-ad test speedup noticed. --- src/Data/Array/Nested/Mixed/Shape.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Data') diff --git a/src/Data/Array/Nested/Mixed/Shape.hs b/src/Data/Array/Nested/Mixed/Shape.hs index c999853..145ea5f 100644 --- a/src/Data/Array/Nested/Mixed/Shape.hs +++ b/src/Data/Array/Nested/Mixed/Shape.hs @@ -36,7 +36,7 @@ import Data.Functor.Product import Data.Kind (Constraint, Type) import Data.Monoid (Sum(..)) import Data.Type.Equality -import GHC.Exts (Int(..), Int#, quotRemInt#, withDict, build) +import GHC.Exts (Int(..), Int#, build, quotRemInt#, withDict) import GHC.Generics (Generic) import GHC.IsList (IsList) import GHC.IsList qualified as IsList @@ -284,6 +284,7 @@ ixxZipWith :: (i -> j -> k) -> IxX sh i -> IxX sh j -> IxX sh k ixxZipWith _ ZIX ZIX = ZIX ixxZipWith f (i :.% is) (j :.% js) = f i j :.% ixxZipWith f is js +{-# INLINEABLE ixxToLinear #-} ixxToLinear :: IShX sh -> IIxX sh -> Int ixxToLinear = \sh i -> fst (go sh i) where -- cgit v1.2.3-70-g09d2