s-cargot-letbind 0.2.4.0 → 0.2.5.0
raw patch · 3 files changed
+12/−6 lines, 3 filesdep ~textnew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: text
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- s-cargot-letbind.cabal +3/−3
- src/Data/SCargot/LetBind.hs +5/−3
ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for s-cargot-letbind +## 0.2.5.0 -- 2024-08-07++ * Relax upper bounds to allowing building with GHC 9.8.+ ## 0.2.4.0 -- 2023-04-03 * Remove upper bound on text (builtin to GHC)
s-cargot-letbind.cabal view
@@ -1,5 +1,5 @@ name: s-cargot-letbind-version: 0.2.4.0+version: 0.2.5.0 synopsis: Enables let-binding and let-expansion for s-cargot defined S-expressions. description: @@ -55,7 +55,7 @@ exposed-modules: Data.SCargot.LetBind build-depends: base >=4.9 && <5 , s-cargot >= 0.1.6.0 && <0.2- , text >=1.2 && <2.1+ , text >=1.2 && <2.2 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall@@ -70,4 +70,4 @@ , HUnit >=1.6 && <1.7 , s-cargot >= 0.1.6.0 && <0.2 , s-cargot-letbind- , text >=1.2 && <2.1+ , text >=1.2 && <2.2
src/Data/SCargot/LetBind.hs view
@@ -21,6 +21,7 @@ import qualified Data.Foldable as F import Data.Function (on) import Data.List ( sortBy, intercalate )+import qualified Data.List.NonEmpty as NE import Data.Maybe import Data.Monoid import Data.SCargot.Repr@@ -183,14 +184,15 @@ bestBindings :: DiscoveryGuide a str -> ExprInfo a -> [Location a] -> [Location a] bestBindings guide exprs locs = getMaxBest- where getMaxBest = head $+ where getMaxBest = NE.head $ -- Sometimes a lengthy binding "swallows" -- everything else; skipping over it would -- result in more available bindings. Try the -- first 3 combinations and take the one -- yielding the most bindings.- sortBy (compare `on` length) $- fmap getBestSkipping [0..2]+ NE.sortBy (compare `on` length) $+ fmap getBestSkipping $+ 0 NE.:| [1, 2] getBestSkipping n = snd $ snd $ -- extract list of Locations -- determine top-set of best bindings to apply foldl bestB (n, (maxbinds, [])) $