Remove Ord Bid & sort in favor of sortBy

[?]
Oct 19, 2015, 4:10 AM
F2XLL7XWGUV4TJD4X2MJADYAQHCSB4HD2TPPEYVHEKHOQIOOFISAC

Dependencies

  • [2] NEDDHXUK Reformat via stylish-haskell
  • [3] 7HPY3QPF Fix linting errors. (yay hlint!)
  • [4] LAROLAYU WIP
  • [5] 75N3UJ4J More progression toward lenses.
  • [6] IZEVQF62 Work in progress replacing sqlite with postgres.
  • [7] WO2MINIF Auctions now compile!
  • [8] TLQ72DSJ Lenses, sqlite-simple

Change contents

  • replacement in lib/Aftok/Auction.hs at line 34
    [3.276][3.123:146](),[3.5405][3.123:146](),[3.146][2.271:286](),[2.286][3.162:195](),[3.162][3.162:195](),[3.195][2.287:297](),[2.297][3.193:241](),[3.288][3.193:241](),[3.241][3.52:99](),[3.99][3.301:342](),[3.301][3.301:342]()
    instance Ord Bid where
    (<=) b1 b2 =
    costRatio b1 <= costRatio b2
    where
    secs bid = toRational $ bid ^. bidSeconds
    btc bid = toRational $ bid ^. bidAmount
    costRatio bid = secs bid / btc bid
    [3.276]
    [3.293]
    bidOrder :: Bid -> Bid -> Ordering
    bidOrder =
    comparing costRatio
    where
    secs bid = toRational $ bid ^. bidSeconds
    btc bid = toRational $ bid ^. bidAmount
    costRatio bid = secs bid / btc bid
  • replacement in lib/Aftok/Auction.hs at line 62
    [3.1147][3.159:195]()
    in takeWinningBids 0 $ sort bids
    [3.1147]
    in takeWinningBids 0 $ sortBy bidOrder bids