diff --git a/hledger-lib/Hledger/Data/Valuation.hs b/hledger-lib/Hledger/Data/Valuation.hs index 327ed6458c4..5c1349cdfb6 100644 --- a/hledger-lib/Hledger/Data/Valuation.hs +++ b/hledger-lib/Hledger/Data/Valuation.hs @@ -27,7 +27,7 @@ import Data.Decimal (roundTo) import Data.Function (on) import Data.Graph.Inductive (Gr, Node, NodeMap, mkMapGraph, mkNode, lab, out, sp) import Data.List --- import Data.List.Extra (nubSortBy) +import Data.List.Extra (nubSortBy) import qualified Data.Map as M import Data.Maybe import qualified Data.Text as T @@ -120,9 +120,7 @@ pricesAtDate pricedirectives d = PriceGraph{prGraph=g, prNodemap=m, prDeclaredPa -- get the latest (on or before date d) declared price for each commodity pair declaredprices :: [MarketPrice] = dbg5 "declaredprices" $ - -- XXX Data.List.Extra.nubSortBy might be more efficient (n Log n vs n^2 ?) - -- but is not in ghc 7.10, 8.0 stackage snapshots - nub $ sortBy (compare `on` (\(MarketPrice{..})->(mpfrom,mpto))) $ -- keep only the first (ie newest and latest parsed) price for each pair + nubSortBy (compare `on` (\(MarketPrice{..})->(mpfrom,mpto))) $ -- keep only the first (ie newest and latest parsed) price for each pair map snd $ -- discard the parse order label sortBy (flip compare `on` (\(parseorder,mp)->(mpdate mp,parseorder))) $ -- sort with newest dates and latest parse order first zip [1..] $ -- label with parse order diff --git a/hledger-lib/hledger-lib.cabal b/hledger-lib/hledger-lib.cabal index 9f5d192a5b9..1b44884dbb1 100644 --- a/hledger-lib/hledger-lib.cabal +++ b/hledger-lib/hledger-lib.cabal @@ -4,7 +4,7 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: 940be6dde18cf33cca2096d9176100b9ba178418eea2f1427d94fc5ffe58e783 +-- hash: 4cfc4e9879ec711800e91c2cfe108a99c36d80ccb81b59e1df314915e94d5523 name: hledger-lib version: 1.14.99 @@ -120,7 +120,7 @@ library , deepseq , directory , easytest >=0.2.1 && <0.3 - , extra + , extra >=1.6.3 , fgl >=5.5.4.0 , file-embed >=0.0.10 , filepath @@ -223,7 +223,7 @@ test-suite doctests , directory , doctest >=0.16 , easytest >=0.2.1 && <0.3 - , extra + , extra >=1.6.3 , fgl >=5.5.4.0 , file-embed >=0.0.10 , filepath @@ -325,7 +325,7 @@ test-suite easytests , deepseq , directory , easytest >=0.2.1 && <0.3 - , extra + , extra >=1.6.3 , fgl >=5.5.4.0 , file-embed >=0.0.10 , filepath diff --git a/hledger-lib/package.yaml b/hledger-lib/package.yaml index 91a94e56042..944b8f37155 100644 --- a/hledger-lib/package.yaml +++ b/hledger-lib/package.yaml @@ -76,7 +76,7 @@ dependencies: - transformers >=0.2 - uglymemo - utf8-string >=0.3.5 -- extra +- extra >=1.6.3 - Glob >= 0.9 # for ledger-parse: #- parsers >=0.5 diff --git a/stack-ghc7.10.yaml b/stack-ghc7.10.yaml index 06d17886ba3..a4009994fe4 100644 --- a/stack-ghc7.10.yaml +++ b/stack-ghc7.10.yaml @@ -35,6 +35,7 @@ extra-deps: - directory-1.2.7.0 - doctest-0.16.0 - exceptions-0.10.0 +- extra-1.6.17 - fgl-5.5.4.0 - free-5.0.2 - generics-sop-0.3.2.0 diff --git a/stack-ghc8.0.yaml b/stack-ghc8.0.yaml index 2a8e3d048de..0a0b248f47a 100644 --- a/stack-ghc8.0.yaml +++ b/stack-ghc8.0.yaml @@ -24,6 +24,7 @@ extra-deps: - config-ini-0.2.3.0 - criterion-1.4.1.0 - doctest-0.16.0 +- extra-1.6.17 - fgl-5.5.4.0 - generics-sop-0.3.2.0 - hashable-1.2.7.0