Factor common JSON conversions up into client lib module.

[?]
Jan 14, 2015, 2:36 AM
W35DDBFYF6Z4ZPCFEO5RPAONZLYCSNTXUSTS6FIUUVZHCI6Q7GHAC

Dependencies

  • [2] TCOAKCGG Completed conversion to snap.
  • [3] OBFPJS2G Project successfully builds and tests under nix.
  • [4] XMONXALY Fix sqlite/readWorkIndex table name
  • [5] ADMKQQGC Initial empty Snap project.
  • [6] WZUHEZSB Start of migration back toward snap.
  • [7] EMVTF2IW WIP moving back to snap.
  • [8] LAROLAYU WIP
  • [9] 64VI73NP Server now compiles using abstracted SQLite
  • [10] 64C6AWH6 Rename Ananke -> Quixotic, project reboot.
  • [11] RSEB2NFG Replacing Snap with Scotty.
  • [12] NTPC7KJE Trivial changes, feature scratchpad.
  • [13] Z3M53KTL Adrift.
  • [*] 5W5M56VJ Move library code to 'lib'

Change contents

  • replacement in TASKS at line 45
    [4.1236][4.1236:1253]()
    Quixotic Service
    [4.1236]
    [4.1253]
    Payouts Service
  • file addition: Json.hs (----------)
    [15.18]
    {-# LANGUAGE ScopedTypeVariables #-}
    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE NoImplicitPrelude #-}
    module Quixotic.Json where
    import ClassyPrelude
    import Control.Lens
    import Data.Aeson
    import Data.Map
    import Quixotic
    import Quixotic.TimeLog
    newtype PayoutsResponse = PayoutsResponse Payouts
    instance ToJSON PayoutsResponse where
    toJSON (PayoutsResponse p) = toJSON m where
    m :: Map Text Double
    m = fmap fromRational $ mapKeys (^. address) p
  • replacement in payouts/Main.hs at line 29
    [3.2102][3.2102:2107]()
    }
    [3.2102]
    [3.2107]
    } deriving Show
  • edit in payouts/Main.hs at line 46
    [3.2655]
    [3.2655]
    putStrLn $ "Searching for unspent payouts " <> tshow cfg
  • file addition: Quixotic (d--r------)
    [3.1482]
  • file addition: Client.hs (----------)
    [0.603]
    {-# LANGUAGE ScopedTypeVariables #-}
    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE NoImplicitPrelude #-}
    module Quixotic.Client where
    import ClassyPrelude
    import Data.Aeson
    import Quixotic
    import Quixotic.Json
  • edit in quixotic.cabal at line 23
    [4.712]
    [4.712]
    Quixotic.Json
  • edit in server/Main.hs at line 8
    [4.5260][2.171:191]()
    import Control.Lens
  • edit in server/Main.hs at line 11
    [4.152][4.2439:2455](),[4.2439][4.2439:2455](),[4.2455][4.90:122]()
    import Data.Map
    import qualified Data.Text as T
  • edit in server/Main.hs at line 12
    [2.256]
    [4.2502]
  • edit in server/Main.hs at line 16
    [4.217]
    [4.2543]
    import Quixotic.Json
  • edit in server/Main.hs at line 18
    [4.2567]
    [4.1565]
  • edit in server/Main.hs at line 70
    [2.1328][4.8456:8457](),[4.2399][4.8456:8457](),[4.3305][4.8456:8457](),[4.6790][4.8456:8457](),[4.8456][4.8456:8457](),[4.3415][4.3415:3465](),[4.2542][4.8536:8537](),[4.3465][4.8536:8537](),[4.8536][4.8536:8537](),[4.8537][4.3466:3506](),[4.3506][4.570:645](),[4.645][2.1329:1380]()
    newtype PayoutsResponse = PayoutsResponse Payouts
    instance A.ToJSON PayoutsResponse where
    toJSON (PayoutsResponse p) = A.toJSON m where
    m :: Map T.Text Double
    m = fmap fromRational $ mapKeys (^. address) p