Auctions now compile!
[?]
Dec 6, 2014, 6:44 PM
WO2MINIF4TXOHWSE7JWXRZYN64XRVLYIRFMF4SMPSOXKA2V77KMQCDependencies
- [2]
LAROLAYUWIP - [3]
GKGVYBZGAdded JSON serialization to TimeLog - [4]
5W5M56VJMove library code to 'lib' - [5]
NVOCQVASInitial failing tests. - [6]
Y35QCWYWMinor improvement in WorkIndex type to eliminate duplicated information. - [7]
EMVTF2IWWIP moving back to snap. - [8]
WZUHEZSBStart of migration back toward snap. - [9]
64C6AWH6Rename Ananke -> Quixotic, project reboot. - [10]
Z3M53KTLAdrift. - [*]
7DBNV3GVInitial, stack-based impl of time log event reduction.
Change contents
- edit in lib/Quixotic/Auction.hs at line 6
import Data.Groupimport Data.Hourglassimport Quixoticimport Quixotic.Users - replacement in lib/Quixotic/Auction.hs at line 20
, hours :: Hours, seconds :: Seconds - replacement in lib/Quixotic/Auction.hs at line 22
}} deriving Eq - replacement in lib/Quixotic/Auction.hs at line 24
winningBids :: Foldable f -> Auction -> f Bid -> [Bid]winningBids =let[2.5405]instance Ord Bid where(<=) b1 b2 =costRatio b1 <= costRatio b2where costRatio bid = (toRational . seconds $ bid) / (toRational . runBTC . btcAmount $ bid)-- lowest bids of seconds/btc winwinningBids :: Auction -> [Bid] -> [Bid]winningBids auction bids =let takeWinningBids :: BTC -> [Bid] -> [Bid]takeWinningBids total (x : xs)-- if the total is fully within the raise amount| total ++ btcAmount x < raiseAmount auction =x : (takeWinningBids (total ++ btcAmount x) xs)-- if the last bid will exceed the raise amount, reduce it to fit| total < raiseAmount auction =let remainder = raiseAmount auction <> invert totalwinFraction = (toRational . runBTC $ remainder) / (toRational . runBTC $ btcAmount x)remainderSeconds = Seconds . round $ winFraction * (toRational . seconds $ x)in [Bid (userId x) remainderSeconds remainder]| otherwise = []takeWinningBids _ [] = []in takeWinningBids mempty $ sort bids - edit in lib/Quixotic/Users.hs at line 6
import Quixotic - replacement in lib/Quixotic/Users.hs at line 8
newtype UserId = UserId Intnewtype UserId = UserId Int deriving (Show, Eq) - edit in lib/Quixotic.hs at line 6[12.1124][3.2505]
, BTC(..) - replacement in lib/Quixotic.hs at line 14
--import Database.PostgreSQL.Simple.FromFieldimport Data.Group - edit in lib/Quixotic.hs at line 18[3.2662][12.1199]
newtype BTC = BTC { runBTC :: Integer } deriving (Show, Eq, Ord)instance Semigroup BTC where(<>) b1 b2 = BTC $ runBTC b1 + runBTC b2instance Monoid BTC wheremempty = BTC 0mappend = (<>)instance Group BTC whereinvert b = BTC . negate . runBTC $ binstance Abelian BTC where - replacement in quixotic.cabal at line 23[3.751]→[3.1152:1211](∅→∅),[3.28]→[3.805:838](∅→∅),[3.1211]→[3.805:838](∅→∅),[3.805]→[3.805:838](∅→∅),[3.838]→[2.6194:6247](∅→∅),[3.1265]→[3.838:1311](∅→∅),[2.6247]→[3.838:1311](∅→∅),[3.838]→[3.838:1311](∅→∅)
build-depends: base >= 4 && < 5, bifunctors, classy-prelude >= 0.10.1, aeson >= 0.8.0.2, cassandra-cql >= 0.4.0.1, containers >= 0.5.5.1, either >= 4.3.1, lens >= 4.4.0.2, old-locale, sqlite == 0.5.2.2, text >= 1.2.0.0, time >= 1.4.2 && < 1.5build-depends:base >= 4 && < 5, bifunctors, classy-prelude >= 0.10.1, aeson >= 0.8.0.2, cassandra-cql >= 0.4.0.1, containers >= 0.5.5.1, either >= 4.3.1, lens >= 4.4.0.2, old-locale, sqlite == 0.5.2.2, text >= 1.2, time >= 1.4.2 && < 1.5, hourglass >= 0.2.6 && < 0.3, groups >= 0.4 - replacement in quixotic.cabal at line 45
build-depends: quixotic, base, aeson, containers, text, time, hspec >= 1.8.1build-depends:quixotic, base, aeson, containers, text, time, hspec >= 1.8.1 - replacement in quixotic.cabal at line 72
, optparse-applicative >= 0.9.0 && < 0.10, bytestring >= 0.9.1 && < 0.11, optparse-applicative >= 0.9.0 && < 0.10, bytestring >= 0.9.1 && < 0.11