Merge branch 'master' of github.com:nuttycom/ananke

[?]
Mar 26, 2014, 4:06 AM
2OIPAQCBDIUJBXB4K2QVP3IEBIUOCQHSWSWFVMVSVZC7GHX2VK7AC

Dependencies

  • [2] GKGVYBZG Added JSON serialization to TimeLog
  • [3] A2J7B4SC Initial impl of depreciation function.
  • [4] NVOCQVAS Initial failing tests.
  • [5] JUUMYIQE Add groupBy utility function for use in TimeLog.
  • [6] 7DBNV3GV Initial, stack-based impl of time log event reduction.
  • [7] 2KZPOGRB Once you get Haskell to compile, the tests pass!
  • [8] 4QX5E5AC Initial compilation of payouts function succeeds.
  • [9] P6NR2CGX Beginning of implementation of depreciation.
  • [10] Y35QCWYW Minor improvement in WorkIndex type to eliminate duplicated information.
  • [11] N4NDAZYT Initial implementation of payouts.
  • [12] EQXRXRZD Changed to use tasty instead of test-framework

Change contents

  • edit in src/Ananke/TimeLog.hs at line 16
    [4.1808]
    [4.76]
    import Control.Applicative
    import Control.Monad
    import Control.Exception.Base
  • edit in src/Ananke/TimeLog.hs at line 22
    [2.186][2.186:225]()
    import qualified Data.Aeson.Types as A
  • edit in src/Ananke/TimeLog.hs at line 24
    [4.119][2.226:258]()
    import qualified Data.Text as T
  • edit in src/Ananke/TimeLog.hs at line 27
    [4.1081]
    [4.108]
    import qualified Data.Aeson.Types as A
    import qualified Data.Text as T
  • edit in src/Ananke/TimeLog.hs at line 31
    [4.200][4.1167:1194](),[4.1167][4.1167:1194](),[4.1194][2.259:280](),[4.24][4.1194:1224](),[2.280][4.1194:1224](),[4.1194][4.1194:1224]()
    import Control.Applicative
    import Control.Monad
    import Control.Exception.Base
  • replacement in src/Ananke/TimeLog.hs at line 83
    [4.1142][4.1142:1199]()
    in M.map (\kt -> toRational $ kt / totalTime) keyTimes
    [4.1142]
    [4.1011]
    in M.map (\kt -> toRational $ kt / totalTime) keyTimes
  • replacement in src/Ananke/TimeLog.hs at line 104
    [2.1024][2.1024:1085]()
    in M.map (bimap (fmap event) (fmap workInterval)) $ logSum
    [2.1024]
    [4.448]
    in M.map (bimap (fmap event) (fmap workInterval)) $ logSum
  • replacement in src/Ananke/TimeLog.hs at line 111
    [4.2210][4.2210:2252]()
    in insert (btcAddr entry) acc workIndex
    [4.2210]
    [4.2252]
    in insert (btcAddr entry) acc workIndex
  • resurrect zombie in src/Ananke/TimeLog.hs at line 121
    [4.970][3.22:375](),[4.970][3.22:375]()
    newtype Months = Months Integer
    monthsLength :: Months -> NominalDiffTime
    monthsLength (Months i) = fromInteger $ 60 * 60 * 24 * 30 * i
    linearDepreciation :: Months -> Months -> Depreciation
    linearDepreciation undepPeriod depPeriod =
    let maxDepreciable :: NominalDiffTime
    maxDepreciable = monthsLength undepPeriod + monthsLength depPeriod
  • resolve order conflict in src/Ananke/TimeLog.hs at line 121
    [2.1131]
    [3.22]
  • edit in src/Ananke/TimeLog.hs at line 131
    [3.375]
    [4.970]
    zeroTime :: NominalDiffTime
    zeroTime = fromInteger 0
  • edit in src/Ananke/TimeLog.hs at line 135
    [4.106][2.1132:1159](),[4.106][2.1132:1159]()
    let depf ndt = undefined
  • resurrect zombie in src/Ananke/TimeLog.hs at line 135
    [2.1159][2.1159:1736](),[2.1159][2.1159:1736]()
    in Depreciation depf
    -- data LogEventParseError = LogEventParseError String deriving (Show, Typeable)
    -- instance Exception LogEventParseError where
    -- instance FromField WorkEvent where
    -- fromField f m = let fromText "start_work" = return StartWork
    -- fromText "stop_work" = return StopWork
    -- fromText a = conversionError $ LogEventParseError $ "unrecognized log event type " ++ a
    -- in fromField f m >>= fromText
    -- instance FromRow LogEntry where
    -- fromRow = LogEntry <$> field <*> field <*> field
  • edit in src/Ananke/TimeLog.hs at line 135
    [4.971]
    [2.1159]
    depf :: NominalDiffTime -> Rational
    depf dt = if dt < monthsLength undepPeriod
    then 1
    else toRational (max zeroTime (maxDepreciable - dt)) / toRational maxDepreciable
  • edit in src/Ananke/TimeLog.hs at line 152
    [2.1736][2.1736:1737](),[2.1736][2.1736:1737](),[4.971][3.376:441]()
    zeroTime :: NominalDiffTime
    zeroTime = fromInteger 0
  • resolve order conflict in src/Ananke/TimeLog.hs at line 152
    [2.1736]
    [3.441]
  • edit in src/Ananke/TimeLog.hs at line 153
    [3.442][3.442:661]()
    depf :: NominalDiffTime -> Rational
    depf dt = if dt < monthsLength undepPeriod
    then 1
    else toRational (max zeroTime (maxDepreciable - dt)) / toRational maxDepreciable
    in Depreciation depf