From 795f905896618628af974d479efc2b5188008416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Facundo=20Dom=C3=ADnguez?= Date: Sat, 18 Nov 2023 09:34:08 -0300 Subject: [PATCH] Stop let generalization in benchmark-vector-algorithms --- .../Data/Vector/Algorithms/AmericanFlag.hs | 1 + .../Data/Vector/Algorithms/Common.hs | 7 ++++--- .../Data/Vector/Algorithms/Insertion.hs | 1 + .../Data/Vector/Algorithms/Intro.hs | 1 + .../Data/Vector/Algorithms/Merge.hs | 1 + .../Data/Vector/Algorithms/Radix.hs | 1 + .../Data/Vector/Algorithms/Search.hs | 1 + 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/AmericanFlag.hs b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/AmericanFlag.hs index f40ac56248..26750d4757 100644 --- a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/AmericanFlag.hs +++ b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/AmericanFlag.hs @@ -1,6 +1,7 @@ {-# OPTIONS_GHC -Wno-partial-type-signatures #-} {-# LANGUAGE PartialTypeSignatures, FlexibleContexts, ScopedTypeVariables #-} {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE MonoLocalBinds #-} -- --------------------------------------------------------------------------- -- | diff --git a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Common.hs b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Common.hs index 121f4db56d..a854800411 100644 --- a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Common.hs +++ b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Common.hs @@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE MonoLocalBinds #-} -- --------------------------------------------------------------------------- -- | @@ -173,12 +174,12 @@ inc arr i = unsafeRead arr i >>= \e -> unsafeWrite arr i (e+1) >> return e countLoop :: (PrimMonad m, MVector v e) => (v (PrimState m) e) -> (PV.MVector (PrimState m) Int) -> (e -> Int) -> m () -countLoop src count rdx = set count 0 >> go len 0 +countLoop src count rdx = set count 0 >> go src len 0 where len = length src - go (m :: Int) i + go v (m :: Int) i | i < len = let lenSrc = length src - in ({- liquidAssert (i < lenSrc) $ -} unsafeRead src i) >>= inc count . rdx >> go (m-1) (i+1) + in ({- liquidAssert (i < lenSrc) $ -} unsafeRead v i) >>= inc count . rdx >> go (m-1) (i+1) | otherwise = return () {-# INLINE countLoop #-} diff --git a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Insertion.hs b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Insertion.hs index cce8bcb1e3..fb8fc2853e 100644 --- a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Insertion.hs +++ b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Insertion.hs @@ -1,4 +1,5 @@ {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE MonoLocalBinds #-} -- --------------------------------------------------------------------------- -- | diff --git a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Intro.hs b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Intro.hs index 1031330861..98f41f8c49 100644 --- a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Intro.hs +++ b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Intro.hs @@ -1,5 +1,6 @@ {-# OPTIONS_GHC -Wno-partial-type-signatures #-} {-# LANGUAGE PartialTypeSignatures, TypeOperators, BangPatterns, ScopedTypeVariables #-} +{-# LANGUAGE MonoLocalBinds #-} -- --------------------------------------------------------------------------- -- | diff --git a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Merge.hs b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Merge.hs index 6d26b4579d..82262c58ae 100644 --- a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Merge.hs +++ b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Merge.hs @@ -1,5 +1,6 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE MonoLocalBinds #-} -- --------------------------------------------------------------------------- -- | diff --git a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Radix.hs b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Radix.hs index 4656c117bc..382ccd4208 100644 --- a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Radix.hs +++ b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Radix.hs @@ -1,5 +1,6 @@ {-@ LIQUID "--no-totality" @-} {-# LANGUAGE ScopedTypeVariables, BangPatterns, TypeOperators #-} +{-# LANGUAGE MonoLocalBinds #-} -- --------------------------------------------------------------------------- -- | diff --git a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Search.hs b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Search.hs index 761ba0a224..4d09567f95 100644 --- a/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Search.hs +++ b/tests/benchmarks/vector-algorithms-0.5.4.2/Data/Vector/Algorithms/Search.hs @@ -1,5 +1,6 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE MonoLocalBinds #-} -- --------------------------------------------------------------------------- -- |